fix: 按swagger对齐用户权限接口

This commit is contained in:
msumshk
2026-01-30 05:15:18 +00:00
parent 32eef23f22
commit f5c8f67830
3 changed files with 4 additions and 13 deletions

View File

@@ -47,7 +47,7 @@ export function fetchGetMenu() {
*/
export function fetchGetUserPermissions(userId: string) {
return request.get<Api.Auth.UserPermissionsResponse>({
url: `/api/admin/v1/auth/permissions/${userId}`
url: `/api/admin/v1/users/${userId}/permissions`
})
}

View File

@@ -145,8 +145,8 @@ export const useUserStore = defineStore(
if (!info.value.userId) return []
try {
const res = await fetchGetUserPermissions(String(info.value.userId))
permissions.value = res.permissions
return res.permissions
permissions.value = res
return res
} catch (error) {
console.error('获取用户权限失败:', error)
return []

View File

@@ -63,16 +63,7 @@ declare namespace Api {
type MenuListResponse = MenuNode[]
/** 用户权限响应 */
interface UserPermissionsResponse {
userId: string
tenantId: string
merchantId: string
account: string
displayName: string
roles: string[]
permissions: string[]
createdAt: string
}
type UserPermissionsResponse = string[]
/** 通过重置链接令牌重置管理员密码请求 */
interface ResetAdminPasswordRequest {