You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
748 B
30 lines
748 B
<script> |
|
import { getUserRolesPermissionMenu } from '@/apis/modules/user.js' |
|
export default { |
|
onLaunch: function() { |
|
// 查询当前角色权限 |
|
uni.getStorageSync('token') && getUserRolesPermissionMenu({ |
|
platformId: 4 |
|
}).then(({ permissionMenu }) => { |
|
const auth = [] |
|
const generateAuth = (list, parent) => { |
|
list.map(e => { |
|
const name = `${parent ? parent + ':' : ''}${e.name}` |
|
auth.push(name) |
|
generateAuth(e.children, name) |
|
}) |
|
} |
|
generateAuth(permissionMenu[0].children, '') |
|
console.log(333, auth) |
|
uni.setStorageSync('auth', auth) |
|
}).catch(e => {}) |
|
}, |
|
onShow: function() { |
|
|
|
} |
|
} |
|
</script> |
|
|
|
<style lang="scss"> |
|
@import '@/uni_modules/uni-scss/index.scss'; |
|
</style>
|
|
|