feat:菜单可配置

This commit is contained in:
houjunxiang
2025-11-27 16:12:25 +08:00
parent f3c15b3692
commit 6c86dc0760
46 changed files with 79 additions and 162 deletions

View File

@@ -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)
}
},