fix: pass through server 403 message instead of hardcoded '无权限'
The axios response interceptor was discarding the server's permission-denied message (e.g. "缺少「用户列表」权限") and replacing it with a generic "无权限". Now it reads the server response body and surfaces the exact permission that's missing.
This commit is contained in:
@@ -1194,8 +1194,9 @@ export default function RolePermissions() {
|
||||
setExpandedRouteIds([]); // 重置展开状态
|
||||
setRoleUsers(users);
|
||||
} catch (error) {
|
||||
const errMsg = error instanceof Error ? error.message : '加载角色权限失败';
|
||||
console.error('加载角色权限失败:', error);
|
||||
toastService.error('加载角色权限失败');
|
||||
toastService.error(errMsg);
|
||||
} finally {
|
||||
setLoadingPermissions(false); // v3.8: 结束加载权限
|
||||
setLoadingUsers(false); // 结束加载用户列表
|
||||
|
||||
Reference in New Issue
Block a user