|
|
|
@ -112,30 +112,32 @@ |
|
|
|
|
methods: { |
|
|
|
|
// 查询当前角色权限 |
|
|
|
|
getAuth() { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中' |
|
|
|
|
}) |
|
|
|
|
uni.getStorageSync('token') && getUserRolesPermissionMenu({ |
|
|
|
|
platformId: 3 |
|
|
|
|
}).then(res => { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
const auth = [] |
|
|
|
|
// 生成权限数组 |
|
|
|
|
const generateAuth = (list, parent) => { |
|
|
|
|
list.map(e => { |
|
|
|
|
const name = `${parent ? parent + ':' : ''}${e.name}` |
|
|
|
|
auth.push(name) |
|
|
|
|
generateAuth(e.children, name) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
generateAuth(res.permissionMenu[0].children, '') |
|
|
|
|
uni.setStorageSync('dataPermission', res.dataPermissionList) |
|
|
|
|
uni.setStorageSync('auth', auth) |
|
|
|
|
this.$forceUpdate() |
|
|
|
|
}).catch(e => { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
uni.setStorageSync('auth', []) |
|
|
|
|
}) |
|
|
|
|
if (uni.getStorageSync('token')) { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中' |
|
|
|
|
}) |
|
|
|
|
getUserRolesPermissionMenu({ |
|
|
|
|
platformId: 3 |
|
|
|
|
}).then(res => { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
const auth = [] |
|
|
|
|
// 生成权限数组 |
|
|
|
|
const generateAuth = (list, parent) => { |
|
|
|
|
list.map(e => { |
|
|
|
|
const name = `${parent ? parent + ':' : ''}${e.name}` |
|
|
|
|
auth.push(name) |
|
|
|
|
generateAuth(e.children, name) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
generateAuth(res.permissionMenu[0].children, '') |
|
|
|
|
uni.setStorageSync('dataPermission', res.dataPermissionList) |
|
|
|
|
uni.setStorageSync('auth', auth) |
|
|
|
|
this.$forceUpdate() |
|
|
|
|
}).catch(e => { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
uni.setStorageSync('auth', []) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 提示暂未开放 |
|
|
|
|
toPanel(i) { |
|
|
|
|