转译控制字符
This commit is contained in:
parent
3d3a3cee40
commit
9c14e806dc
|
|
@ -8,6 +8,7 @@ import (
|
|||
"encoding/binary"
|
||||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
|
@ -179,6 +180,11 @@ func (t *UnixSocketTask) handleConnection(conn net.Conn) {
|
|||
loading = false // 停止加载动画
|
||||
t.writeMessage(conn, "\r")
|
||||
}
|
||||
|
||||
// 替换控制标记
|
||||
question = strings.ReplaceAll(question, "[end]", "[/end]")
|
||||
question = strings.ReplaceAll(question, "[sthttp]", "[/sthttp]")
|
||||
|
||||
// 当收到非空question时发送[res]响应
|
||||
res := constants.ColorGreen + question + constants.ColorBlue
|
||||
logger.Debug("write: %s", res)
|
||||
|
|
|
|||
Loading…
Reference in New Issue