测试分支合并请求2222
This commit is contained in:
9
app.js
9
app.js
@ -1,8 +1,11 @@
|
||||
const { checkLogin } = require('./utils/logcheck');
|
||||
const { checkLogin, checkLogin2 } = require('./utils/logcheck');
|
||||
App({
|
||||
|
||||
onLaunch: function () {
|
||||
checkLogin();
|
||||
checkLogin();
|
||||
checkLogin2()
|
||||
checkLogin2()
|
||||
checkLogin2()
|
||||
checkLogin2()
|
||||
checkLogin2()
|
||||
}
|
||||
});
|
||||
|
@ -20,6 +20,31 @@ function checkLogin() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function checkLogin2() {
|
||||
try {
|
||||
const user = wx.getStorageSync('usermessage');
|
||||
if (!user || (typeof user === 'object' && Object.keys(user).length === 0)) {
|
||||
wx.showToast({
|
||||
title: '您未登录请先登录',
|
||||
icon:'error',
|
||||
duration:2000
|
||||
})
|
||||
setTimeout(() => {
|
||||
wx.navigateTo({
|
||||
url: '/pages/logain/logain',
|
||||
});
|
||||
}, 2000);
|
||||
}
|
||||
} catch (e) {
|
||||
wx.navigateTo({
|
||||
url: '/pages/logain/logain',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
module.exports = {
|
||||
checkLogin
|
||||
checkLogin, checkLogin2
|
||||
};
|
||||
|
Reference in New Issue
Block a user