From e69a45ac873f79f85ddb1d4015aed752afd2f9ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=BE=81?= Date: Tue, 17 May 2022 12:37:32 +0800 Subject: [PATCH 1/2] merge --- nuxt.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuxt.config.js b/nuxt.config.js index 57b5147..66bcdb8 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -45,7 +45,7 @@ export default { '@plugins/axiosTk.js', '@plugins/vue-inject.js', '@/plugins/v-distpicker', - '@/plugins/router', + // '@/plugins/router', '@/plugins/im' ], From 1240635f5c1f27ad517a50d3a334e2fa9977efb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=BE=81?= Date: Tue, 17 May 2022 14:29:27 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E4=B8=BA=E4=BD=A0?= =?UTF-8?q?=E6=8E=A8=E8=8D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/BsChosen.vue | 3 ++- pages/account/index/message.vue | 4 ++-- plugins/im.js | 10 +++++++--- store/index.js | 1 + 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/components/BsChosen.vue b/components/BsChosen.vue index 097ff1b..308f9c6 100644 --- a/components/BsChosen.vue +++ b/components/BsChosen.vue @@ -39,7 +39,8 @@ export default { categoryId: "", order: "", }); - vm.recommendedData = res.result; + console.log(res.result) + vm.recommendedData = res.result.records; }, }, }; diff --git a/pages/account/index/message.vue b/pages/account/index/message.vue index 5064ecd..58b3a7a 100644 --- a/pages/account/index/message.vue +++ b/pages/account/index/message.vue @@ -43,10 +43,10 @@ export default { return {}; }, computed: { - ...mapState(["token"], ["socketMsgData"]), + ...mapState(["token","socketMsgData"]), }, mounted(){ - console.log(`socketMsgData`,this.socketMsgData) + console.log(`socketMsgData`,this.$store) }, methods: {}, }; diff --git a/plugins/im.js b/plugins/im.js index e88ae1a..b6d0484 100644 --- a/plugins/im.js +++ b/plugins/im.js @@ -18,7 +18,7 @@ Vue.prototype.$startWebSockets = function () { Vue.prototype.Socket.onopen = () => { let traceId = guid(); Vue.prototype.Socket.send( - `{"traceId":${traceId},traceType:1,"content":{"size": 100}}` + `{"traceId":"${traceId}",traceType:1,"content":{"size": 100}}` ); }; Vue.prototype.Socket.onclose = () => { @@ -40,7 +40,7 @@ Vue.prototype.$startWebSockets = function () { if (msg.traceType == 1) { let traceId = guid(); let sys = msg.content.sessionVOS.find((item) => item.type != 3); - let str = `{"traceId":${traceId},traceType:2,"content":{"sessionId":${sys.id}}}`; + let str = `{"traceId":"${traceId}",traceType:2,"content":{"sessionId":${sys.id}}}`; Vue.prototype.Socket.send(str); this.$store.commit("setUnreadCount", msg.content.totalUnreadCount); } @@ -54,9 +54,13 @@ Vue.prototype.$startWebSockets = function () { if (msg.traceType == 3) { let traceId = guid(); Vue.prototype.Socket.send( - `{"traceId":${traceId},traceType:1,"content":{"size": 100}}` + `{"traceId":"${traceId}",traceType:1,"content":{"size": 100}}` ); } + + setTimeout(()=>{ + console.log(this.$store.state) + },500) }; } }; diff --git a/store/index.js b/store/index.js index f7315b5..a655789 100644 --- a/store/index.js +++ b/store/index.js @@ -54,6 +54,7 @@ const mutations = { }, setSocketMsgData(state, val){ state.socketMsgData = val; + console.log(state.socketMsgData) } }; const actions = {