diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 6bcb7af..443f0c7 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -21,6 +21,7 @@ declare global { const deleteChildDict: typeof import('./src/api/dictApi')['deleteChildDict'] const deleteMenu: typeof import('./src/api/menu')['deleteMenu'] const deleteParentDict: typeof import('./src/api/dictApi')['deleteParentDict'] + const deleteRole: typeof import('./src/api/roleApi')['deleteRole'] const deleteUser: typeof import('./src/api/roleApi')['deleteUser'] const editParentMenu: typeof import('./src/api/menu')['editParentMenu'] const effectScope: typeof import('vue')['effectScope'] diff --git a/src/api/roleApi.ts b/src/api/roleApi.ts index e5808d6..9f278d9 100644 --- a/src/api/roleApi.ts +++ b/src/api/roleApi.ts @@ -35,6 +35,7 @@ export interface RoleListReturn { id: string; name: string; normalizedName: string; + ChineseName:string } export function getRoleList(): Promise { return http({ @@ -48,24 +49,27 @@ interface EnableRoleQuery { userId: string; roleName: string; } -export function enableRole(data: EnableRoleQuery) { +export function enableRole(params: EnableRoleQuery) { return http({ - url: "/api/v1/AdminRoleControllers/role", + url: "/api/v1/AdminRoleControllers/role/endow", method: "POST", - data, + params, }); } // 添加新角色 interface NewRoleReq{ rolename:string - normalizedname:string + ChineseName:string } export function addNewRole(params:NewRoleReq){ return http({ url:'/api/v1/AdminRoleControllers/role', method:'POST', - params + params:{ + ...params, + normalizedname:'suibiantiande' + } }) } @@ -82,3 +86,14 @@ export function assignMenu(data:MenuRequest) { data, }); } + +// 删除指定角色 +export function deleteRole(id:string){ + return http({ + url:'/api/v1/AdminRoleControllers/role', + method:'DELETE', + params:{ + id + } + }) +} \ No newline at end of file diff --git a/src/components/Ls-UI/LsRoleBase.vue b/src/components/Ls-UI/LsRoleBase.vue index 40a978a..513c775 100644 --- a/src/components/Ls-UI/LsRoleBase.vue +++ b/src/components/Ls-UI/LsRoleBase.vue @@ -12,9 +12,11 @@ {{ item.name }} - {{ item.normalizedName }} + {{ item.chineseName }} - 选择 + 选择 + 删除 @@ -22,10 +24,10 @@ - - 新增 + 新增 @@ -43,7 +45,7 @@