feat:菜单可配置
This commit is contained in:
@@ -69,7 +69,6 @@ const user = defineStore({
|
||||
icon: 'success',
|
||||
title: '登录成功'
|
||||
})
|
||||
// await this.getRoleMenus()
|
||||
// await this.getDeviceTimeout()
|
||||
// this.startTimeoutChecker()
|
||||
// 如果已经存在默认模块就跳转到对应的模块
|
||||
@@ -86,19 +85,18 @@ const user = defineStore({
|
||||
}
|
||||
},
|
||||
async getUserInfo() {
|
||||
const { user } = await userApi.getInfo()
|
||||
const { user, menus } = await userApi.getInfo()
|
||||
if (user) {
|
||||
this.userInfo = user
|
||||
uni.setStorageSync('userInfo', this.userInfo)
|
||||
this.getRoleMenus(menus)
|
||||
}
|
||||
},
|
||||
async getRoleMenus() {
|
||||
let params = {
|
||||
parentNodeUrl: '/lims/mobile'
|
||||
}
|
||||
const result = await userApi.getRoleMenusByParentMenuKey(params)
|
||||
if (result.length > 0) {
|
||||
this.roleMenus = result.map(item => ({ url: item.url, name: item.name, icon: item.otherConf }))
|
||||
async getRoleMenus(menus) {
|
||||
const parentNodePath = '/lims/mobile'
|
||||
let result = menus.find(item => item.path === parentNodePath)
|
||||
if (result) {
|
||||
this.roleMenus = result.children
|
||||
uni.setStorageSync('roleMenus', this.roleMenus)
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user