Explorar o código

feat 视频列表跳转问题

erekook hai 11 meses
pai
achega
81655b5696
Modificáronse 2 ficheiros con 12 adicións e 1 borrados
  1. 11 1
      pages/video/video.js
  2. 1 0
      utils/request.js

+ 11 - 1
pages/video/video.js

@@ -53,6 +53,7 @@ Page({
     onLoad(options) {
         console.log('打开视频列表页面--------------------------')
         wx.setStorageSync('jump', parseInt(options.jump)) // 是否跳转阅读器
+        this.autoLogin(options.promotionid);
         if (!app.globalData.uuid) {
             this.getUUID().then(uuid => {
                 // getApp().globalData.uuid = uuid
@@ -83,6 +84,15 @@ Page({
         // this.handleEntrace(options);
     },
 
+    // 自动登录
+    async autoLogin(promotionid) {
+        try {
+            await getApp().login(promotionid);
+        } catch (error) {
+            console.error('登录失败:', error);
+        }
+    },
+
     onShow() {
         console.log('页面显示--------------------------')
         this.rewardVideoLoad()
@@ -121,7 +131,7 @@ Page({
                             // });
                         }
                     });
-                }, 500);
+                }, 800);
             } else {
                 // 第二次进入把isEnterVideoDetail恢复默认值
                 app.globalData.isEnterVideoDetail = true;

+ 1 - 0
utils/request.js

@@ -160,6 +160,7 @@ export const requestAll = (requestUrl, body, method = 'POST', customHeaders = {}
             }
           }
           else if (res.data.code == 20001) {
+            console.error('令牌过期', url);
             reject({ code: 20001, msg: '令牌过期' });
           }
           else {