@@ -11,6 +11,15 @@
onLaunch: function() {
},
onShow: function() {
+ if(uni.getStorageSync('userInfo')){
+ uni.reLaunch({
+ url:'/pages/home'
+ })
+ }else{
+ url:'/pages/login'
+ }
onHide: function() {
}
@@ -19,13 +19,6 @@
agree:false
- onShow: () => {
- if(uni.getStorageSync('userInfo')){
- uni.reLaunch({
- url:'/pages/home'
- })
- }
- },
methods:{
changeAgree(){
this.agree = !this.agree;
@@ -70,9 +70,17 @@
uni.navigateTo({ url })
exitLogin(){
- uni.clearStorageSync();
- url:'/pages/login'
+ uni.showModal({
+ title:'温馨提示',
+ content:'是否确定退出登录?',
+ success: (res) => {
+ if(res.confirm){
+ uni.clearStorageSync();
})