From 0021ce240cba74f8a0846957a1b580e45142f84e Mon Sep 17 00:00:00 2001 From: tangchengming <445785772@qq.com> Date: Mon, 24 Feb 2025 14:32:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9D=90=E5=B8=AD=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 1 + src/pages/layout/components/LayoutHeader.vue | 37 ++++++++++++++++++-- src/store/index.js | 5 +++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index 9c8e900..16ba146 100644 --- a/src/App.vue +++ b/src/App.vue @@ -117,6 +117,7 @@ export default { voiceCall.webCalling().then(res => { const {agent, token, sdkAppId, agentId, sdkURL} = res; // console.log(res, '---res') + this.$store.commit('setAgent', agent) if (agent){ let userId = agentId; let sdkUrl = sdkURL; diff --git a/src/pages/layout/components/LayoutHeader.vue b/src/pages/layout/components/LayoutHeader.vue index 171ca82..830e3f5 100644 --- a/src/pages/layout/components/LayoutHeader.vue +++ b/src/pages/layout/components/LayoutHeader.vue @@ -22,7 +22,7 @@ {{ userInfo.realName || userInfo.showName || '-' }} -
+
@@ -241,7 +241,7 @@ diff --git a/src/store/index.js b/src/store/index.js index 6251619..b62b636 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -11,6 +11,7 @@ const vuexPersisted = new CreatePersistedState({ token: state.token, //需要持久化的数据 routes: state.routes, userinfo: state.userinfo, + agent: state.agent }) }) @@ -26,6 +27,7 @@ const store = new Vuex.Store({ routes: [], // 从后端获取的路由菜单 brokerEndpoint: '', videoReminder: '', + agent: false, // 是否绑定坐席 }, plugins: [vuexPersisted], // 全局同步方法, 调用方法,this.$store.commit("xxx",'赋值数据') @@ -47,6 +49,9 @@ const store = new Vuex.Store({ }, setVideoReminder(state, data) { state.videoReminder = data; + }, + setAgent(state, data) { + state.agent = data; } },