瀏覽代碼

修改bug

潘超林 1 周之前
父節點
當前提交
f50c122bc9
共有 1 個文件被更改,包括 11 次插入1 次删除
  1. 11 1
      TUIKit/components/TUIChat/message-list/index.vue

+ 11 - 1
TUIKit/components/TUIChat/message-list/index.vue

@@ -362,14 +362,24 @@ const goGroup = async () => {
     });
   }
 };
+const GetQueryString = (name: string) => {
+  var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
+
+  var r = window.location.search.substr(1).match(reg);
+
+  if (r != null) return unescape(r[2]);
+  return null;
+};
 
 const isMerchantShow = ref(false);
 const isMerchant = async () => {
   if (currentConversationID.value.includes("GROUP")) {
     isMerchantShow.value = false;
   } else {
-    let id = currentConversationID.value.slice(3);
+    // let id = currentConversationID.value.slice(3);
+    let id = GetQueryString("id");
     let res = await mesApi.default.getUserInfo(id);
+
     if (res.data.userTypes.includes("2")) {
       isMerchantShow.value = true;
     } else {