From 89d33476c7ab9bf7a4fbad399685652eabd478de Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期六, 07 九月 2024 11:17:15 +0800 Subject: [PATCH] token --- packageDomain/pages/resourceDetails/myVideo/index.js | 32 +++++++++++++++++++++++++------- 1 files changed, 25 insertions(+), 7 deletions(-) diff --git a/packageDomain/pages/resourceDetails/myVideo/index.js b/packageDomain/pages/resourceDetails/myVideo/index.js index 24c52d0..5a5d299 100644 --- a/packageDomain/pages/resourceDetails/myVideo/index.js +++ b/packageDomain/pages/resourceDetails/myVideo/index.js @@ -1,6 +1,8 @@ // pages/resourceDetails/index.js const app = getApp() - +import { + loginInfo +} from '../../../../assets/js/login'; Page({ /** @@ -88,7 +90,17 @@ parentName: options.parentName, }) } - this.resourceDetailsData() + const token = wx.getStorageSync(app.config.tokenKey) + if (!token) { + loginInfo(app, (data) => { + if (data) { + this.resourceDetailsData() + } else { + this.resourceDetailsData() + } + }) + } + }, @@ -307,13 +319,19 @@ aliVod(md5, currentVideo) { let query = { md5: md5, - appRefCode: config.appRefCode + appRefCode: app.config.appRefCode } - MG.file.getAliVod(query).then((res) => { + app.MG.file.getAliVod(query).then((res) => { if (res) { - this.setData({ - showDataVod: res, - }) + if (res && res.data == '') { + this.setData({ + showDataVod: currentVideo, + }) + } else { + this.setData({ + showDataVod: res, + }) + } } else if (currentVideo) { this.setData({ showDataVod: currentVideo, -- Gitblit v1.9.1