|
@@ -4,24 +4,14 @@
|
|
} from "@dcloudio/uni-app"
|
|
} from "@dcloudio/uni-app"
|
|
import {
|
|
import {
|
|
toast,
|
|
toast,
|
|
- getUserIdentity
|
|
|
|
} from "@/utils/common";
|
|
} from "@/utils/common";
|
|
import cacheManager from "@/utils/cacheManager.js";
|
|
import cacheManager from "@/utils/cacheManager.js";
|
|
export default {
|
|
export default {
|
|
-
|
|
|
|
// creat by wgy 0619 生命周期 钩子
|
|
// creat by wgy 0619 生命周期 钩子
|
|
onLaunch: function() {
|
|
onLaunch: function() {
|
|
// #ifdef APP-PLUS
|
|
// #ifdef APP-PLUS
|
|
if (cacheManager.get('auth')) {
|
|
if (cacheManager.get('auth')) {
|
|
- uni.reLaunch({
|
|
|
|
- url: `/pages/study/index`,
|
|
|
|
- success() {
|
|
|
|
- plus.navigator.closeSplashscreen();
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }else if(cacheManager.get('wxLogin') &&!(cacheManager.get('wxLogin').bind)){
|
|
|
|
- console.log('微信登录且未绑定')
|
|
|
|
- // 微信登录且未绑定
|
|
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
cacheManager.clearAll()
|
|
cacheManager.clearAll()
|
|
uni.reLaunch({
|
|
uni.reLaunch({
|
|
@@ -31,24 +21,11 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- // #endif
|
|
|
|
|
|
+ // #endif
|
|
},
|
|
},
|
|
onShow: function() {
|
|
onShow: function() {
|
|
|
|
|
|
// #ifdef APP-PLUS
|
|
// #ifdef APP-PLUS
|
|
- // if (cacheManager.get('auth')) {
|
|
|
|
- // uni.reLaunch({
|
|
|
|
- // url: `/pages/study/index`
|
|
|
|
- // })
|
|
|
|
- // }else if(!(cacheManager.get('wxLogin').bind)){
|
|
|
|
- // console.log('asdfadsfadsfasd')
|
|
|
|
- // // 微信登录且未绑定
|
|
|
|
- // } else {
|
|
|
|
- // cacheManager.clearAll()
|
|
|
|
- // uni.redirectTo({
|
|
|
|
- // url: '/pages/login/index'
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
const webview = plus.webview.currentWebview();
|
|
const webview = plus.webview.currentWebview();
|
|
plus.key.addEventListener('backbutton', () => {
|
|
plus.key.addEventListener('backbutton', () => {
|
|
event.preventDefault();
|
|
event.preventDefault();
|
|
@@ -57,23 +34,6 @@
|
|
// #endif
|
|
// #endif
|
|
},
|
|
},
|
|
onHide: function() {
|
|
onHide: function() {
|
|
- // // console.log('App Hide')
|
|
|
|
- // // #ifdef APP-PLUS
|
|
|
|
- // if (cacheManager.get('auth')) {
|
|
|
|
- // uni.reLaunch({
|
|
|
|
- // url: `/pages/study/index`
|
|
|
|
- // })
|
|
|
|
- // }else if(!(cacheManager.get('wxLogin').bind)){
|
|
|
|
- // console.log('asdfadsfadsfasd')
|
|
|
|
- // // 微信登录且未绑定
|
|
|
|
- // } else {
|
|
|
|
- // cacheManager.clearAll()
|
|
|
|
- // uni.redirectTo({
|
|
|
|
- // url: '/pages/login/index'
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // // #endif
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|