Browse Source

更改im链接

gcz 3 years ago
parent
commit
5a292980b0
1 changed files with 23 additions and 2 deletions
  1. 23 2
      src/views/Question.vue

+ 23 - 2
src/views/Question.vue

@@ -8,7 +8,7 @@
     <section class="question-wrap">
       <!-- src="https://web.sdk.qcloud.com/im/demo/latest/index.html" -->
       <iframe        
-        src="https://veterhchat.hw.hongweisoft.com/"
+        :src="iframeUrl"
         class="mapFrame"
         ref="mapFrame"
       ></iframe>
@@ -25,9 +25,13 @@ export default {
   data() {
     return {
       type: "",
+      userInfo:{},
+      iframeUrl:'',
     };
   },
-  created() {},
+  created() {
+     this.getUserInfo();
+  },
   mounted() {
     // https://blog.csdn.net/qq_39024950/article/details/90317738
     let mapFrame = this.$refs["mapFrame"];
@@ -58,6 +62,23 @@ export default {
       };
     }
   },
+  methods:{
+    getUserInfo() {
+      this.$api
+        .getUserInfo()
+        .then((res) => {
+          // 当请求成功
+          if (res.code == "200") {
+            console.log("getUserInfo res", res);
+            this.userInfo = res.data;
+            this.iframeUrl =`http://veterhchat.hw.hongweisoft.com/#/pages/login/login?userID=${res.data.id}&type=teacher`
+          }
+        })
+        .catch((error) => {
+          console.log(error);
+        });
+    },
+  }
 };
 </script>
 <style lang="scss" scoped>