feat: restore settings routes for admin modules
This commit is contained in:
@@ -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'
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user