lsc 3 年之前
父节点
当前提交
ee4eea7c28
共有 1 个文件被更改,包括 28 次插入1 次删除
  1. 28 1
      src/components/pages/Grid.vue

+ 28 - 1
src/components/pages/Grid.vue

@@ -729,13 +729,40 @@ export default {
         .post(this.$store.state.api + "insertRoom", params)
         .then((res) => {
           this.$message.success("创建成功");
-          this.selectRoom(this.userid);
+          this.getRoom(res.data[0][0].fid);
         })
         .catch((err) => {
           this.$message.error("创建失败");
           console.error(err);
         });
     },
+    getRoom(fid) {
+      let params = {
+        fid: fid,
+      };
+      this.ajax
+        .get(this.$store.state.api + "getRoom", params)
+        .then((res) => {
+          if (res.data[0].length) {
+            // this.RoomInfo = res.data[0][0];
+            // this.data = JSON.parse(res.data[0][0].data);
+            // this.dialogVisible3 = false;
+            // this.dialogVisible2 = true;
+            debugger
+            this.getMindNetwork(res.data[0][0].id, this.userinfo.userid);
+            // this.data.splice(0,1)
+            // this.updateRoomData()
+            // this.timer = setInterval(() => {
+            //   this.selectRoom2(uid);
+            // }, 5000);
+          } else {
+            // this.$message.error("此房间不存在或已被解散");
+          }
+        })
+        .catch((err) => {
+          console.error(err);
+        });
+    },
     selectRoom(uid) {
       let params = {
         uid: uid,