|
@@ -6,8 +6,8 @@ import (
|
|
"app.yhyue.com/moapp/jybase/date"
|
|
"app.yhyue.com/moapp/jybase/date"
|
|
"app.yhyue.com/moapp/jybase/fsw"
|
|
"app.yhyue.com/moapp/jybase/fsw"
|
|
"context"
|
|
"context"
|
|
- "encoding/json"
|
|
|
|
"fmt"
|
|
"fmt"
|
|
|
|
+ "github.com/gogf/gf/v2/encoding/gjson"
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
"github.com/gogf/gf/v2/net/ghttp"
|
|
"github.com/gogf/gf/v2/net/ghttp"
|
|
"github.com/gogf/gf/v2/os/glog"
|
|
"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
|
|
jSession := SessionCtx.Get(m.Ctx).JSession
|
|
|
|
|
|
req := &QuestionReq{}
|
|
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)
|
|
glog.Errorf(m.Ctx, "%d 接收消息Unmarshal出错:%v", jSession.AccountId, err)
|
|
return
|
|
return
|
|
}
|
|
}
|