|
|
|
@ -110,7 +110,8 @@ |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
per: true, // 是否有权限 |
|
|
|
|
teamId: uni.getStorageSync('team').teamId || '', |
|
|
|
|
// teamId: uni.getStorageSync('team').teamId || '', |
|
|
|
|
teamId: '', |
|
|
|
|
list: [], |
|
|
|
|
id: '', |
|
|
|
|
teamList: [] |
|
|
|
@ -133,6 +134,7 @@ |
|
|
|
|
teamId: this.teamId, |
|
|
|
|
platformId: 4 |
|
|
|
|
}).then(({ permissionMenu }) => { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
const auth = [] |
|
|
|
|
const generateAuth = (list, parent) => { |
|
|
|
|
list.map(e => { |
|
|
|
@ -146,28 +148,36 @@ |
|
|
|
|
this.$forceUpdate() |
|
|
|
|
this.initRole() |
|
|
|
|
}).catch(e => { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
uni.setStorageSync('auth', []) |
|
|
|
|
this.initRole() |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 获取团队 |
|
|
|
|
getInfo() { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中' |
|
|
|
|
}) |
|
|
|
|
getTeamsByAccountId().then(({ data }) => { |
|
|
|
|
data.map(e => { |
|
|
|
|
const n = e.partnerClassificationList |
|
|
|
|
e.id = n.id |
|
|
|
|
e.teamId = e.partnerClassificationId |
|
|
|
|
e.teamId = n.isTeam == 1 ? e.partnerClassificationId : n.id |
|
|
|
|
e.partnerClassificationName = n.partnerClassificationName |
|
|
|
|
delete e.partnerClassificationList |
|
|
|
|
}) |
|
|
|
|
if (data.length) { |
|
|
|
|
// 如果是第一次进,则默认选中第一个团队,并把该团队的信息存入缓存 |
|
|
|
|
if (!this.teamId) { |
|
|
|
|
/** |
|
|
|
|
* @description 如果是第一次进,则默认选中第一个团队,并把该团队的信息存入缓存 |
|
|
|
|
* 或者团队列表里没有该id,则说明超管已经被转让,也需要重新选中团队 |
|
|
|
|
*/ |
|
|
|
|
if (!this.teamId || !data.find(e => e.teamId == this.teamId)) { |
|
|
|
|
this.teamId = data[0].teamId |
|
|
|
|
uni.setStorageSync('team', data[0]) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// 如果没有团队,则退出登录 |
|
|
|
|
uni.hideLoading() |
|
|
|
|
uni.clearStorageSync() |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '../login/login' |
|
|
|
@ -176,7 +186,9 @@ |
|
|
|
|
|
|
|
|
|
this.list = data |
|
|
|
|
this.getAuth() |
|
|
|
|
}).catch(e => {}) |
|
|
|
|
}).catch(e => { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 团队选择回调 |
|
|
|
|
teamChange() { |
|
|
|
|