|
|
@@ -256,6 +256,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import { mapGetters } from 'vuex';
|
|
|
import {
|
|
|
generateRandomString
|
|
|
} from "@/utils/common.js"
|
|
|
@@ -449,6 +450,21 @@
|
|
|
avataruser() {
|
|
|
return this.userinfos.avatar
|
|
|
},
|
|
|
+ ...mapGetters(['coureLogin']),
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ coureLogin: {
|
|
|
+ immediate: true, // 页面一进入就检查一次
|
|
|
+ handler(val) {
|
|
|
+ console.log(val ,this.isLogin)
|
|
|
+ if (val == 2) {
|
|
|
+ console.log("看课AppToken失效,请重新登录")
|
|
|
+ this.isLogin = false
|
|
|
+ this.isAddKf = 0
|
|
|
+ this.goLogin()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
|
|
|
@@ -495,11 +511,11 @@
|
|
|
// this.sortLink = this.urlOption.link || ''
|
|
|
this.getMenuButton()
|
|
|
// #ifdef MP-WEIXIN
|
|
|
- // if(this.$store.state.logoname!=='乐氏本源'&&!uni.getStorageSync('userInfos')){
|
|
|
+ // if(this.$store.state.logoname!=='乐氏本源'&&!uni.getStorageSync('userinfos')){
|
|
|
// 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({
|
|
|
// url:'/pages_course/webview'
|
|
|
// })
|
|
|
@@ -509,7 +525,7 @@
|
|
|
},
|
|
|
onShow() {
|
|
|
this.userinfos = uni.getStorageSync('userinfos')
|
|
|
- this.userinfo = uni.getStorageSync('userinfo')
|
|
|
+ this.userinfo = uni.getStorageSync('userInfo')
|
|
|
this.tipsOpen = false
|
|
|
this.isExpand = true
|
|
|
this.uuId = generateRandomString(16)
|
|
|
@@ -518,17 +534,30 @@
|
|
|
}
|
|
|
const AppToken = uni.getStorageSync('TOKEN_WEXIN')
|
|
|
console.log(AppToken)
|
|
|
- if (AppToken) {
|
|
|
- // this.isLogin=true
|
|
|
- this.getUserInfoLooks()
|
|
|
- if (this.isAddKf == 1 && this.userinfo.userId) {
|
|
|
- console.log(1233)
|
|
|
- this.getH5CourseVideoDetails()
|
|
|
- } else {
|
|
|
- // this.checkUserInfoA()
|
|
|
- this.getIsAddKf()
|
|
|
+ // if (AppToken) {
|
|
|
+ // console.log("console.log(AppToken,this.userinfo)===",this.userinfo)
|
|
|
+ // // this.isLogin=true
|
|
|
+ // this.getUserInfoLooks()
|
|
|
+ // if (this.isAddKf == 1 && this.userinfo.userId) {
|
|
|
+ // console.log(1233)
|
|
|
+ // this.getH5CourseVideoDetails()
|
|
|
+ // } else {
|
|
|
+ // // this.checkUserInfoA()
|
|
|
+ // this.getIsAddKf()
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ this.$isLoginCourse().then(res=>{
|
|
|
+ if(res) {
|
|
|
+ this.getUserInfoLooks()
|
|
|
+ if (this.isAddKf == 1 && this.userinfo.userId) {
|
|
|
+ console.log(1233)
|
|
|
+ this.getH5CourseVideoDetails()
|
|
|
+ } else {
|
|
|
+ // this.checkUserInfoA()
|
|
|
+ this.getIsAddKf()
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ })
|
|
|
// if(this.sortLink){
|
|
|
// this.getLink()
|
|
|
// } else {
|
|
|
@@ -579,7 +608,7 @@
|
|
|
},
|
|
|
methods: {
|
|
|
getUserInfoLooks() {
|
|
|
- getUserInfoLook().then(res => {
|
|
|
+ getUserInfoLook({userId:this.userinfo.userId}).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.userinfos.nickname = res.user.nickname
|
|
|
this.userInfo = res.user;
|
|
|
@@ -682,7 +711,7 @@
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- uni.setStorageSync('userInfos', this.userinfos)
|
|
|
+ uni.setStorageSync('userinfos', this.userinfos)
|
|
|
this.editUserA()
|
|
|
this.userlogo = false
|
|
|
},
|
|
|
@@ -744,8 +773,8 @@
|
|
|
console.log(loginRes)
|
|
|
console.log(e)
|
|
|
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({
|
|
|
encryptedData: e.mp.detail.encryptedData,
|
|
|
iv: e.mp.detail.iv,
|
|
|
@@ -837,8 +866,8 @@
|
|
|
console.log(loginRes)
|
|
|
console.log(e)
|
|
|
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({
|
|
|
encryptedData: e.mp.detail.encryptedData,
|
|
|
iv: e.mp.detail.iv,
|