feat: 重构用户角色系统为管理员标识
- 将用户角色字段从role改为is_admin布尔值 - 更新相关API权限检查逻辑 - 修改数据库schema和迁移文件 - 调整前端用户显示逻辑 - 添加API响应工具函数 - 优化权限检查中间件 - 重构英雄组件为原子组件
This commit is contained in:
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
import '@testing-library/jest-dom';
|
||||
|
||||
declare module 'expect' {
|
||||
interface Matchers<R, T> extends jest.Matchers<R, T> {}
|
||||
}
|
||||
Vendored
+3
-3
@@ -4,18 +4,18 @@ declare module 'next-auth' {
|
||||
interface Session {
|
||||
user: {
|
||||
id: string;
|
||||
role: string;
|
||||
isAdmin: boolean;
|
||||
} & DefaultSession['user'];
|
||||
}
|
||||
|
||||
interface User {
|
||||
role: string;
|
||||
isAdmin: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'next-auth/jwt' {
|
||||
interface JWT {
|
||||
id: string;
|
||||
role: string;
|
||||
isAdmin: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user