Browse Source

二维码管理动态获取地址

qymljy 1 week ago
parent
commit
f872d18a8c
1 changed files with 17 additions and 10 deletions
  1. 17 10
      src/HDrpManagement/codeManage/index.vue

+ 17 - 10
src/HDrpManagement/codeManage/index.vue

@@ -55,21 +55,28 @@ export default {
       this.$refs.basicLayout.listData()
     },
     async codeClick(code){
-      console.log(code,'code')
       this.dialogVisible = true
+      console.log(this.url,'urlURL')
       this.bigUrl = this.url + '?code=' + code
-      const res = await this.$api.requested({
-        "id": 2025082515112802,
-        "content": {
-          "code": code
-        },
-      })
-      console.log(res.data)
-      // this.bigUrl = this.url + '?data=' + res.data
     },
     callback(){
-      console.log('测试内容1111')
+    },
+    getURL () {
+      var str = window.location.href;
+      var index = str.indexOf('/');
+      var num = 0;
+      while(index !== -1) {
+        num++;
+        index = str.indexOf('/',index + 1);
+        if (num++ === 3) {
+          this.url = str.slice(0, index) + '/yosweb/codeToFile.html'
+          return str.slice(0, index);
+        }
+      }
     }
+  },
+  mounted() {
+    this.getURL()
   }
 }
 </script>