个人中心登录逻辑调整

This commit is contained in:
唐明明
2022-06-07 17:38:39 +08:00
parent b76167eb0d
commit 76554a096c
5 changed files with 4504 additions and 4525 deletions

View File

@@ -90,7 +90,6 @@
this.$Router.replace({name: 'AuthRole'}) this.$Router.replace({name: 'AuthRole'})
return return
} }
this.$Router.back()
this.$Router.pushTab({name: 'Life'}) this.$Router.pushTab({name: 'Life'})
uni.hideLoading() uni.hideLoading()
}).catch((err) => { }).catch((err) => {

View File

@@ -72,7 +72,7 @@
storage_id : this.storageId storage_id : this.storageId
}).then(res => { }).then(res => {
this.$store.commit('setIsNew', 1) this.$store.commit('setIsNew', 1)
this.$Router.back() this.$Router.pushTab({name: 'Life'})
}).catch(err => { }).catch(err => {
this.disabled = false this.disabled = false
uni.showToast({ uni.showToast({

View File

@@ -225,45 +225,25 @@
}, },
// 个人档案 // 个人档案
onFiles() { onFiles() {
if (this.isLogin()) {
console.log("登录") console.log("登录")
}
}, },
// 按钮导航 // 按钮导航
onBtn(name, params) { onBtn(name, params) {
if (this.isLogin()) {
this.$Router.push({ this.$Router.push({
name, name,
params params
}); });
}
}, },
goSetting() { goSetting() {
if (this.isLogin()) {
this.$Router.push({ this.$Router.push({
name: 'Setting' name: 'Setting'
}) })
}
},
// 检查登录
isLogin() {
if (this.$store.state.token === '') {
const Auth = new userAuth();
Auth.Login();
return false;
}
return true;
}, },
// 退出登录 // 退出登录
logOut() { logOut() {
this.userInfo = {
nickname: '',
avatar: '',
identity: []
};
this.$store.commit('setToken', ''); this.$store.commit('setToken', '');
// 断开IM链接 this.$store.commit('setIsNew', '');
im.disconnect() this.$Router.replaceAll({name: 'Auth'})
}, },
copy(data) { copy(data) {
uni.setClipboardData({ uni.setClipboardData({

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long