update permission

This commit is contained in:
Timi
2026-08-11 12:02:38 +08:00
parent e5473eb499
commit bb1fdb5547
4 changed files with 100 additions and 4 deletions
+10 -2
View File
@@ -1,5 +1,5 @@
import { axios } from "./BaseAPI";
import type { Page, PageResult, Permission, PermissionPayload } from "../types";
import type { ModuleCode, Page, PageResult, Permission, PermissionPayload } from "../types";
const BASE_URI = "/user/permission";
@@ -21,9 +21,17 @@ async function remove(id: string): Promise<void> {
});
}
/** 查询当前登录用户在指定模块内可转授的权限。 */
async function grantableList(moduleCode: ModuleCode): Promise<Permission[]> {
return await axios.post(`${BASE_URI}/grantable/list`, undefined, {
params: { moduleCode }
});
}
export default {
list,
create,
update,
remove
remove,
grantableList
};