|
@@ -274,6 +274,7 @@
|
|
|
<script>
|
|
<script>
|
|
|
import { generateRandomString} from "@/utils/common.js"
|
|
import { generateRandomString} from "@/utils/common.js"
|
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
|
|
|
+ import { mapGetters } from 'vuex';
|
|
|
import {
|
|
import {
|
|
|
getErrMsg,
|
|
getErrMsg,
|
|
|
getH5CourseByVideoId,
|
|
getH5CourseByVideoId,
|
|
@@ -463,6 +464,20 @@
|
|
|
avataruser() {
|
|
avataruser() {
|
|
|
return this.userinfos.avatar
|
|
return this.userinfos.avatar
|
|
|
},
|
|
},
|
|
|
|
|
+ ...mapGetters(['coureLogin']),
|
|
|
|
|
+ },
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ coureLogin: {
|
|
|
|
|
+ immediate: true, // 页面一进入就检查一次
|
|
|
|
|
+ handler(val) {
|
|
|
|
|
+ if (val == 2&&this.isLogin) {
|
|
|
|
|
+ console.log("看课AppToken失效,请重新登录")
|
|
|
|
|
+ this.isLogin = false
|
|
|
|
|
+ this.isAddKf = 0
|
|
|
|
|
+ this.goLogin()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
|
this.getWebviewUrl()
|
|
this.getWebviewUrl()
|
|
@@ -507,11 +522,11 @@
|
|
|
// this.sortLink = this.urlOption.link || ''
|
|
// this.sortLink = this.urlOption.link || ''
|
|
|
this.getMenuButton()
|
|
this.getMenuButton()
|
|
|
// #ifdef MP-WEIXIN
|
|
// #ifdef MP-WEIXIN
|
|
|
- // if(this.$store.state.logoname!=='乐氏本源'&&!uni.getStorageSync('userInfos')){
|
|
|
|
|
|
|
+ // if(this.$store.state.logoname!=='乐氏本源'&&!uni.getStorageSync('userinfos')){
|
|
|
// this.userlogo=true
|
|
// this.userlogo=true
|
|
|
// }
|
|
// }
|
|
|
- console.log(uni.getStorageSync('userInfos'))
|
|
|
|
|
- if(!uni.getStorageSync('userInfos')&&this.$store.state.logoname=='乐氏本源'){
|
|
|
|
|
|
|
+ console.log(uni.getStorageSync('userinfos'))
|
|
|
|
|
+ if(!uni.getStorageSync('userinfos')&&this.$store.state.logoname=='乐氏本源'){
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
url:'/pages_course/webview'
|
|
url:'/pages_course/webview'
|
|
|
})
|
|
})
|
|
@@ -521,7 +536,7 @@
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
this.userinfos=uni.getStorageSync('userinfos')
|
|
this.userinfos=uni.getStorageSync('userinfos')
|
|
|
- this.userinfo=uni.getStorageSync('userinfo')
|
|
|
|
|
|
|
+ this.userInfo=uni.getStorageSync('userInfo')
|
|
|
this.tipsOpen = false
|
|
this.tipsOpen = false
|
|
|
this.isExpand = true
|
|
this.isExpand = true
|
|
|
this.uuId = generateRandomString(16)
|
|
this.uuId = generateRandomString(16)
|
|
@@ -532,7 +547,7 @@
|
|
|
console.log(AppToken)
|
|
console.log(AppToken)
|
|
|
if(AppToken){
|
|
if(AppToken){
|
|
|
// this.isLogin=true
|
|
// this.isLogin=true
|
|
|
- if(this.isAddKf == 1&&this.userinfo.userId){
|
|
|
|
|
|
|
+ if(this.isAddKf == 1&&this.userInfo.userId){
|
|
|
console.log(1233)
|
|
console.log(1233)
|
|
|
this.getH5CourseVideoDetails()
|
|
this.getH5CourseVideoDetails()
|
|
|
} else{
|
|
} else{
|
|
@@ -629,10 +644,10 @@
|
|
|
uni.getStorageSync('TOKEN_WEXIN');
|
|
uni.getStorageSync('TOKEN_WEXIN');
|
|
|
this.userInfo=uni.getStorageSync('userInfo');
|
|
this.userInfo=uni.getStorageSync('userInfo');
|
|
|
this.isLogin = true
|
|
this.isLogin = true
|
|
|
- this.getH5CourseVideoDetails()
|
|
|
|
|
- // setTimeout(()=>{
|
|
|
|
|
- // this.getIsAddKf()
|
|
|
|
|
- // },200)
|
|
|
|
|
|
|
+ // this.getH5CourseVideoDetails()
|
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
|
+ this.getIsAddKf()
|
|
|
|
|
+ },200)
|
|
|
}else if(res.code==406){
|
|
}else if(res.code==406){
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -680,7 +695,7 @@
|
|
|
});
|
|
});
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- uni.setStorageSync('userInfos',this.userinfos)
|
|
|
|
|
|
|
+ uni.setStorageSync('userinfos',this.userinfos)
|
|
|
this.editUserA()
|
|
this.editUserA()
|
|
|
this.userlogo=false
|
|
this.userlogo=false
|
|
|
},
|
|
},
|
|
@@ -742,7 +757,7 @@
|
|
|
console.log(loginRes)
|
|
console.log(loginRes)
|
|
|
console.log(e)
|
|
console.log(e)
|
|
|
let code = loginRes.code // 获取开发code
|
|
let code = loginRes.code // 获取开发code
|
|
|
- this.userinfos=uni.getStorageSync('userInfos')?uni.getStorageSync('userInfos'):this.userinfos
|
|
|
|
|
|
|
+ this.userinfos=uni.getStorageSync('userinfos')?uni.getStorageSync('userinfos'):this.userinfos
|
|
|
loginByMiniApp({
|
|
loginByMiniApp({
|
|
|
encryptedData: e.mp.detail.encryptedData,
|
|
encryptedData: e.mp.detail.encryptedData,
|
|
|
iv: e.mp.detail.iv,
|
|
iv: e.mp.detail.iv,
|
|
@@ -833,7 +848,7 @@
|
|
|
console.log(loginRes)
|
|
console.log(loginRes)
|
|
|
console.log(e)
|
|
console.log(e)
|
|
|
let code = loginRes.code // 获取开发code
|
|
let code = loginRes.code // 获取开发code
|
|
|
- this.userinfos=uni.getStorageSync('userInfos')?uni.getStorageSync('userInfos'):this.userinfos
|
|
|
|
|
|
|
+ this.userinfos=uni.getStorageSync('userinfos')?uni.getStorageSync('userinfos'):this.userinfos
|
|
|
loginByMiniApp({
|
|
loginByMiniApp({
|
|
|
encryptedData: e.mp.detail.encryptedData,
|
|
encryptedData: e.mp.detail.encryptedData,
|
|
|
iv: e.mp.detail.iv,
|
|
iv: e.mp.detail.iv,
|