mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 09:34:19 +08:00
refactor(api): remove unnecessary userId param (#675)
* refactor(api): remove unnecessary userId param 移除getUserInfo、getPermCode、getMenuList接口的userId参数。 这些接口应当始终与当前登录用户相关而无需传递userId。 * fix: fix auth header key case error
This commit is contained in:
@@ -41,13 +41,13 @@ export function usePermission() {
|
||||
* Reset and regain authority resource information
|
||||
* @param id
|
||||
*/
|
||||
async function resume(id?: string | number) {
|
||||
async function resume() {
|
||||
const tabStore = useMultipleTabStore();
|
||||
tabStore.clearCacheTabs();
|
||||
resetRouter();
|
||||
const routes = await permissionStore.buildRoutesAction(id);
|
||||
const routes = await permissionStore.buildRoutesAction();
|
||||
routes.forEach((route) => {
|
||||
router.addRoute((route as unknown) as RouteRecordRaw);
|
||||
router.addRoute(route as unknown as RouteRecordRaw);
|
||||
});
|
||||
permissionStore.setLastBuildMenuTime();
|
||||
closeAll();
|
||||
@@ -103,12 +103,11 @@ export function usePermission() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Change menu
|
||||
* refresh menu data
|
||||
*/
|
||||
async function changeMenu(id?: string | number) {
|
||||
// TODO The id passed in here is for testing. Actually, you don’t need to pass it. The id of the login person will be automatically obtained.
|
||||
resume(id);
|
||||
async function refreshMenu() {
|
||||
resume();
|
||||
}
|
||||
|
||||
return { changeRole, hasPermission, togglePermissionMode, changeMenu };
|
||||
return { changeRole, hasPermission, togglePermissionMode, refreshMenu };
|
||||
}
|
||||
|
Reference in New Issue
Block a user