liuyu 4 năm trước cách đây
mục cha
commit
649ac54230
2 tập tin đã thay đổi với 26 bổ sung22 xóa
  1. 13 11
      src/views/live/roomDetail.vue
  2. 13 11
      src/views/live/roomMeet.vue

+ 13 - 11
src/views/live/roomDetail.vue

@@ -145,17 +145,19 @@ export default {
       });
     },
     async lookuserSearch() {
-      let data = {};
-      data.roomid = this.id;
-      data.roomname = this.roomname;
-      data.userid = this.user.uid;
-      data.username = this.user.name;
-      const res = await this.lookuserFetch(data);
-      // 根据房间id查询房间详细信息
-      let result = await this.fetch(this.id);
-      if (this.$checkRes(result)) {
-        console.log(result.data);
-        this.$set(this, `roomInfos`, result.data);
+      if (this.user.uid) {
+        let data = {};
+        data.roomid = this.id;
+        data.roomname = this.roomname;
+        data.userid = this.user.uid;
+        data.username = this.user.name;
+        const res = await this.lookuserFetch(data);
+        // 根据房间id查询房间详细信息
+        let result = await this.fetch(this.id);
+        if (this.$checkRes(result)) {
+          console.log(result.data);
+          this.$set(this, `roomInfos`, result.data);
+        }
       }
     },
     async lookusercountsel() {

+ 13 - 11
src/views/live/roomMeet.vue

@@ -188,17 +188,19 @@ export default {
       }
     },
     async lookuserSearch() {
-      let data = {};
-      data.roomid = this.id;
-      data.roomname = this.roomname;
-      data.userid = this.user.uid;
-      data.username = this.user.name;
-      const res = await this.lookuserFetch(data);
-      // 根据房间id查询房间详细信息
-      let result = await this.fetch(this.id);
-      if (this.$checkRes(result)) {
-        console.log(result.data);
-        this.$set(this, `roomInfos`, result.data);
+      if (this.user.uid) {
+        let data = {};
+        data.roomid = this.id;
+        data.roomname = this.roomname;
+        data.userid = this.user.uid;
+        data.username = this.user.name;
+        const res = await this.lookuserFetch(data);
+        // 根据房间id查询房间详细信息
+        let result = await this.fetch(this.id);
+        if (this.$checkRes(result)) {
+          console.log(result.data);
+          this.$set(this, `roomInfos`, result.data);
+        }
       }
     },
     async lookusercountsel() {