89213734 by 杨炀

2.0.2版本 fix:小程序分享,小程序密码修改,小程序直接进入登录页

1 parent 3772b55d
......@@ -10,7 +10,6 @@ let firstload = false
export default {
onLaunch: function(options) {
console.log('App Launch', options);
firstload = true
this.globalData.baseUrl_api = config.baseUrl_api;
if(loginUrl.indexOf(options.path)==-1){
......@@ -18,17 +17,20 @@ export default {
if (userName) {
getInfo().then(() => {
this.globalData.isLogin = true;
firstload = true
let firstLoadCallback = getApp().firstLoadCallback;
if (firstLoadCallback) {
firstLoadCallback();
}
}).catch(() => {
firstload = true
uni.redirectTo({
url: '/login/login'
})
})
} else {
this.globalData.isLogin = false;
firstload = true
uni.redirectTo({
url: '/login/login'
})
......@@ -36,27 +38,12 @@ export default {
}
},
onShow: function() {
// if(firstload&&!this.globalData.isLogin){
// console.log('App Show');
// uni.redirectTo({
// url: '/login/login'
// })
// }
if(firstload){
getInfo().then(() => {
this.globalData.isLogin = true;
let firstLoadCallback = getApp().firstLoadCallback;
if (firstLoadCallback) {
firstLoadCallback();
}
}).catch(() => {
console.log('App Show',firstload,this.globalData.isLogin);
if(firstload&&!this.globalData.isLogin){
uni.redirectTo({
url: '/login/login'
})
})
}
},
onHide: function() {
console.log('App Hide');
......
......@@ -205,6 +205,7 @@
}
function getCode() {
uni.hideLoading()
getCodeImg().then((res) => {
codeUrl.value = 'data:image/gif;base64,' + res.data.img
form.value.uuid = res.data.uuid
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!