Commit 0dc39dc412b3c463239b31e036a7033201eb19ec
1 parent
a4d79181
fix:修改左侧菜单不需要按钮级别,api接口添加needButton=false
Showing
2 changed files
with
8 additions
and
3 deletions
| ... | ... | @@ -14,14 +14,19 @@ enum Api { |
| 14 | 14 | * @description: Get user menu based on id |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | -export const getMenuList = () => { | |
| 17 | +export const getMenuList = (args) => { | |
| 18 | 18 | const userStore = useUserStore(); |
| 19 | 19 | let url = Api.GetMenuList; |
| 20 | 20 | try { |
| 21 | 21 | if (userStore.getRoleList.find((v) => v == RoleEnum.SYS_ADMIN)) { |
| 22 | 22 | url = Api.SysAdminMenuList; |
| 23 | 23 | } |
| 24 | - return defHttp.get<getMenuListResultModel>({ url }); | |
| 24 | + return defHttp.get<getMenuListResultModel>({ | |
| 25 | + url, | |
| 26 | + params: { | |
| 27 | + needButton: args == 1 ? false : null, | |
| 28 | + }, | |
| 29 | + }); | |
| 25 | 30 | } catch (e) {} |
| 26 | 31 | }; |
| 27 | 32 | ... | ... |
| ... | ... | @@ -230,7 +230,7 @@ export const usePermissionStore = defineStore({ |
| 230 | 230 | ] as AppRouteRecordRaw[]; |
| 231 | 231 | } else { |
| 232 | 232 | this.changePermissionCode(); |
| 233 | - routeList = (await getMenuList()) as AppRouteRecordRaw[]; | |
| 233 | + routeList = (await getMenuList(1)) as AppRouteRecordRaw[]; | |
| 234 | 234 | createStorage('MENU_LIST', JSON.stringify(routeList)); |
| 235 | 235 | setAuthCache('MENU_LIST', routeList); |
| 236 | 236 | } | ... | ... |