|
@@ -23,6 +23,7 @@
|
|
|
</u-cell-group>
|
|
|
</view>
|
|
|
|
|
|
+ <u-toast ref="uToast" />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -74,13 +75,24 @@
|
|
|
if (res.confirm) {
|
|
|
this.$u.api.loginOut({})
|
|
|
.then(res=>{
|
|
|
- uni.showToast({
|
|
|
- title: '退出成功',
|
|
|
- duration: 2000
|
|
|
- });
|
|
|
- uni.redirectTo({
|
|
|
- url:'../login/login'
|
|
|
- });
|
|
|
+ uni.clearStorage();
|
|
|
+ this.$u.vuex('vuex_token', null);
|
|
|
+ this.$u.vuex('vuex_user', null);
|
|
|
+ this.$u.vuex('vuex_hasLogin', false);
|
|
|
+ this.userInfo = [];
|
|
|
+ this.theRoad = [];
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: '退出成功,即将跳转登录页!',
|
|
|
+ type: 'success',
|
|
|
+ url:'pages/login/login'
|
|
|
+ });
|
|
|
+ // uni.showToast({
|
|
|
+ // title: '退出成功',
|
|
|
+ // duration: 2000
|
|
|
+ // });
|
|
|
+ // uni.redirectTo({
|
|
|
+ // url:'../login/login'
|
|
|
+ // });
|
|
|
}).catch(err=>{
|
|
|
uni.showToast({
|
|
|
title: '退出失败',
|