From 31f438edfa20a4653f5eea02959b03d3bba103db Mon Sep 17 00:00:00 2001 From: Chopper Date: Mon, 21 Feb 2022 22:45:39 +0800 Subject: [PATCH] =?UTF-8?q?IM=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer/src/pages/GoodsDetail.vue | 29 +++++++------------ .../sys/setting-manage/setting/IM_SETTING.vue | 6 +--- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/buyer/src/pages/GoodsDetail.vue b/buyer/src/pages/GoodsDetail.vue index 7554bb1e..0772fed7 100644 --- a/buyer/src/pages/GoodsDetail.vue +++ b/buyer/src/pages/GoodsDetail.vue @@ -21,16 +21,7 @@ {{storeCollected ? '已收藏店铺' : '收藏店铺'}} - - 联系客服 - - - 联系客服 - + 联系客服 @@ -58,6 +49,7 @@ import { } from "@/api/member"; import { getDetailById } from "@/api/shopentry"; import { getIMDetail } from "@/api/common"; +import Storage from "../plugins/storage"; export default { name: "GoodsDetail", beforeRouteEnter(to, from, next) { @@ -66,7 +58,6 @@ export default { }, created() { this.getGoodsDetail(); - // this.getIMDetailMethods(); }, data() { return { @@ -80,8 +71,15 @@ export default { }, methods: { // 跳转im客服 - IMService() { - window.open(this.IM); + async IMService() { + // 获取访问Token + let accessToken = Storage.getItem('accessToken'); + await this.getIMDetailMethods(); + if (!accessToken) { + this.$Message.error("请登录后再联系客服"); + return; + } + window.open(this.IMLink + "?token=" + accessToken + "&id=" + this.goodsMsg.data.storeId); }, // 获取im信息 async getIMDetailMethods() { @@ -186,11 +184,6 @@ export default { location.reload(); }, }, - computed: { - IM() { - return this.IMLink + this.storeMsg.merchantEuid; - }, - }, components: { Search, ShopHeader, diff --git a/manager/src/views/sys/setting-manage/setting/IM_SETTING.vue b/manager/src/views/sys/setting-manage/setting/IM_SETTING.vue index 82372a7b..36a47c8a 100644 --- a/manager/src/views/sys/setting-manage/setting/IM_SETTING.vue +++ b/manager/src/views/sys/setting-manage/setting/IM_SETTING.vue @@ -4,9 +4,6 @@ - - -
@@ -22,8 +19,7 @@ export default { return { ruleValidate: {}, // 验证规则 formValidate: { // 表单数据 - httpUrl: "", - tenantId: "" + httpUrl: "" }, }; },