Skip to content

Commit

Permalink
fix: 修复普通用户登陆之后菜单未能正常获取的问题 (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
eryajf authored Mar 9, 2023
1 parent f8ecfe3 commit 2549045
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/api/system/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ export function getUserMenusByUserId(Id) {
})
}

// 获取用户的可访问菜单树 (已完成)
export function getUserMenuTreeByUserId() {
// 获取用户的可访问菜单树
export function getUserMenuTreeByUserId(params) {
return request({
url: '/api/menu/tree',
method: 'get'
url: '/api/menu/access/tree/',
method: 'get',
params
})
}
}
2 changes: 1 addition & 1 deletion src/store/modules/permission.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const actions = {
let accessedRoutes = []
const {roles}=userinfo
// 获取菜单树
getUserMenuTreeByUserId().then(res => {
getUserMenuTreeByUserId({id: roles[0].ID}).then(res => {

const { data } = res
const menuTree = data
Expand Down

0 comments on commit 2549045

Please sign in to comment.