89213734 by 杨炀

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

1 parent 3772b55d
......@@ -10,53 +10,40 @@ 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){
let userName = uni.getStorageSync('userName')
if (userName) {
getInfo().then(() => {
this.globalData.isLogin = true;
this.globalData.isLogin = true;
firstload = true
let firstLoadCallback = getApp().firstLoadCallback;
if (firstLoadCallback) {
firstLoadCallback();
}
}).catch(() => {
}).catch(() => {
firstload = true
uni.redirectTo({
url: '/login/login'
})
})
} else {
this.globalData.isLogin = false;
this.globalData.isLogin = false;
firstload = true
uni.redirectTo({
url: '/login/login'
})
}
}
},
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(() => {
uni.redirectTo({
url: '/login/login'
})
onShow: function() {
console.log('App Show',firstload,this.globalData.isLogin);
if(firstload&&!this.globalData.isLogin){
uni.redirectTo({
url: '/login/login'
})
}
},
onHide: function() {
console.log('App Hide');
......
......@@ -121,7 +121,7 @@
onLoad(() => {
getCode()
if (uni.showShareMenu) {
uni.showShareMenu({
withShareTicket: true,
......@@ -204,7 +204,8 @@
})
}
function getCode() {
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!