diff --git a/pages.json b/pages.json
index cbc3c91..405b532 100644
--- a/pages.json
+++ b/pages.json
@@ -110,6 +110,9 @@
},
{
"path": "work/addResume"
+ },
+ {
+ "path": "auth/switchIdentity"
}
]
}],
diff --git a/pages_order/auth/switchIdentity.vue b/pages_order/auth/switchIdentity.vue
new file mode 100644
index 0000000..826f7bd
--- /dev/null
+++ b/pages_order/auth/switchIdentity.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
diff --git a/pages_order/mine/setting.vue b/pages_order/mine/setting.vue
index 64a8c63..f516846 100644
--- a/pages_order/mine/setting.vue
+++ b/pages_order/mine/setting.vue
@@ -11,6 +11,7 @@
icon="coupon"
title="切换账号"
isLink
+ @click="$utils.navigateTo('/pages_order/auth/wxLogin')"
iconStyle="font-size: 34rpx;"
rightIconStyle="font-size: 34rpx;">
@@ -23,6 +24,7 @@
icon="coupon"
title="切换身份"
isLink
+ @click="$utils.navigateTo('/pages_order/auth/switchIdentity')"
iconStyle="font-size: 34rpx;"
rightIconStyle="font-size: 34rpx;">
@@ -52,6 +54,7 @@
icon="coupon"
title="清理缓存"
isLink
+ @click="clearCache"
iconStyle="font-size: 34rpx;"
rightIconStyle="font-size: 34rpx;">
@@ -64,6 +67,7 @@
icon="coupon"
title="退出登录"
isLink
+ @click="$store.commit('logout')"
iconStyle="font-size: 34rpx;"
rightIconStyle="font-size: 34rpx;">
@@ -91,7 +95,25 @@
if (item.text === this.$t('pageTitle.languageSwitch')) {
this.$refs.changeLanguage.open();
}
- }
+ },
+ // 清理缓存
+ clearCache(){
+ uni.showModal({
+ title: '确认清理缓存吗?',
+ success(r) {
+ if(r.confirm){
+ uni.showLoading()
+ setTimeout(() => {
+ uni.hideLoading()
+ uni.showToast({
+ title: '缓存清理成功!',
+ icon: 'none'
+ })
+ }, 800)
+ }
+ }
+ })
+ },
},
}
diff --git a/store/store.js b/store/store.js
index ae68a9b..3d0dba1 100644
--- a/store/store.js
+++ b/store/store.js
@@ -113,6 +113,21 @@ const store = new Vuex.Store({
state.banner = res.result.records
})
},
+ logout(state){
+ uni.showModal({
+ title: '确认退出登录吗',
+ success(r) {
+ if(r.confirm){
+ state.userInfo = {}
+ state.role = false
+ uni.removeStorageSync('token')
+ uni.redirectTo({
+ url: '/pages/index/index'
+ })
+ }
+ }
+ })
+ },
},
actions: {},
})