潘超林 дней назад: 6
Родитель
Сommit
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 {