瀏覽代碼

feat:恢复

wangshan 2 年之前
父節點
當前提交
cca09a65e5
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      internal/model/ws.go

+ 2 - 2
internal/model/ws.go

@@ -6,8 +6,8 @@ import (
 	"app.yhyue.com/moapp/jybase/date"
 	"app.yhyue.com/moapp/jybase/fsw"
 	"context"
-	"encoding/json"
 	"fmt"
+	"github.com/gogf/gf/v2/encoding/gjson"
 	"github.com/gogf/gf/v2/frame/g"
 	"github.com/gogf/gf/v2/net/ghttp"
 	"github.com/gogf/gf/v2/os/glog"
@@ -30,7 +30,7 @@ func (m *WsChat) Handle(ws *ghttp.WebSocket, msg []byte) {
 	jSession := SessionCtx.Get(m.Ctx).JSession
 
 	req := &QuestionReq{}
-	if err := json.Unmarshal(msg, &req); err != nil {
+	if err := gjson.Unmarshal(msg, req); err != nil {
 		glog.Errorf(m.Ctx, "%d 接收消息Unmarshal出错:%v", jSession.AccountId, err)
 		return
 	}