feat: restore settings routes for admin modules

This commit is contained in:
wren
2026-04-29 18:39:45 +08:00
parent 1b67358e5b
commit 790b9566e1
3 changed files with 15 additions and 13 deletions
+4 -4
View File
@@ -271,7 +271,7 @@ export async function getRoleDetail(roleId: number): Promise<RoleInfo | null> {
export async function getRoutes(): Promise<RouteInfo[]> {
try {
// 调用后端API获取当前用户的路由(provincial_admin应该有所有路由权限)
const response = await get<any>('/rbac/user/routes');
const response = await get<any>('/api/rbac/user/routes');
if (response.error) {
console.error('❌ [getRoutes] API调用失败:', response.error);
@@ -375,7 +375,7 @@ export async function getAllRoutes(
export async function getRoleRoutePermissions(roleId: number): Promise<RoleRoutePermission[]> {
try {
// 使用 axios-client 的 get 函数调用真实后端API
const response = await get<any>(`/rbac/roles/${roleId}/routes`);
const response = await get<any>(`/api/rbac/roles/${roleId}/routes`);
if (response.error) {
throw new Error(response.error);
@@ -417,7 +417,7 @@ export async function getRoleRoutesWithPermissions(roleId: number): Promise<{
selectedPermissionIds: number[];
}> {
try {
const response = await get<any>(`/rbac/roles/${roleId}/routes`);
const response = await get<any>(`/api/rbac/roles/${roleId}/routes`);
if (response.error) {
throw new Error(response.error);
@@ -566,7 +566,7 @@ export async function updateRoleRoutePermissions(
): Promise<{ success: boolean; message: string; code?: number }> {
try {
// 使用 axios-client 的 put 函数调用真实后端API
const response = await put<any>(`/rbac/roles/${roleId}/routes`, {
const response = await put<any>(`/api/rbac/roles/${roleId}/routes`, {
route_ids: routeIds,
permission: 'RW'
});