Procházet zdrojové kódy

加斜杠补全路径

谢杰标 před 2 roky
rodič
revize
32593926ee
2 změnil soubory, kde provedl 8 přidání a 6 odebrání
  1. 1 1
      pages/learn/index.vue
  2. 7 5
      pages/webview/index.vue

+ 1 - 1
pages/learn/index.vue

@@ -957,7 +957,7 @@ export default {
       // buyCourse 是否购买课程:1是 0否
       let encode = encodeURIComponent(
         this.config.hostLive +
-          "pages/live/index?token=" +
+          "/pages/live/index?token=" +
           uni.getStorageSync("token") +
           "&userInfo=" +
           JSON.stringify(this.userInfo) +

+ 7 - 5
pages/webview/index.vue

@@ -15,7 +15,7 @@
 
 <script>
 import { mapGetters } from "vuex";
-import { tenantId } from '@/common/request.js'
+import { tenantId } from "@/common/request.js";
 export default {
   components: {},
   data() {
@@ -67,7 +67,10 @@ export default {
         this.getParam();
       }
     } else {
-      this.url = decodeURIComponent(decodeURIComponent(this.options.url));
+      this.url =
+        decodeURIComponent(decodeURIComponent(this.options.url)) +
+        "&tid=" +
+        tenantId;
       console.log("小程序进来的url:", this.url);
       let index = this.url.indexOf("?");
       let paramArr = this.url.slice(index + 1).split("&");
@@ -78,12 +81,11 @@ export default {
       this.paramObj = paramObj;
       this.sectionType = this.paramObj.sectionType || 2; // 默认直播,回放的加了sectionType=3
       this.vid = this.paramObj.vid || "";
-      this.url = this.url + "&tid=" + tenantId;
       this.studyLog(paramObj);
     }
   },
   computed: {
-    ...mapGetters(["userInfo",'config']),
+    ...mapGetters(["userInfo", "config"]),
   },
   methods: {
     getInfo() {
@@ -125,7 +127,7 @@ export default {
             // buyCourse 是否购买课程:1是 0否
             this.url =
               this.config.hostLive +
-              "pages/live/index?token=" +
+              "/pages/live/index?token=" +
               uni.getStorageSync("token") +
               "&userInfo=" +
               JSON.stringify(this.userInfo) +