diff --git a/backend-service/pkg/service/socket.go b/backend-service/pkg/service/socket.go index 3e9124f..440f541 100644 --- a/backend-service/pkg/service/socket.go +++ b/backend-service/pkg/service/socket.go @@ -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)