mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
refactor(projects): 动态路由权限完善
This commit is contained in:
40
mock/model/auth.ts
Normal file
40
mock/model/auth.ts
Normal file
@ -0,0 +1,40 @@
|
||||
interface UserModel extends Auth.UserInfo {
|
||||
token: string;
|
||||
refreshToken: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export const userModel: UserModel[] = [
|
||||
{
|
||||
token: '__TOKEN_SOYBEAN__',
|
||||
refreshToken: '__REFRESH_TOKEN_SOYBEAN__',
|
||||
userId: '0',
|
||||
userName: 'Soybean',
|
||||
userRole: 'super',
|
||||
password: 'soybean123'
|
||||
},
|
||||
{
|
||||
token: '__TOKEN_SUPER__',
|
||||
refreshToken: '__REFRESH_TOKEN_SUPER__',
|
||||
userId: '1',
|
||||
userName: 'Super',
|
||||
userRole: 'super',
|
||||
password: 'super123'
|
||||
},
|
||||
{
|
||||
token: '__TOKEN_ADMIN__',
|
||||
refreshToken: '__REFRESH_TOKEN_ADMIN__',
|
||||
userId: '2',
|
||||
userName: 'Admin',
|
||||
userRole: 'admin',
|
||||
password: 'admin123'
|
||||
},
|
||||
{
|
||||
token: '__TOKEN_USER01__',
|
||||
refreshToken: '__REFRESH_TOKEN_USER01__',
|
||||
userId: '3',
|
||||
userName: 'User01',
|
||||
userRole: 'user',
|
||||
password: 'user01123'
|
||||
}
|
||||
];
|
||||
2
mock/model/index.ts
Normal file
2
mock/model/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from './auth';
|
||||
export * from './route';
|
||||
@ -1,4 +1,4 @@
|
||||
const routes: Record<Auth.RoleType, AuthRoute.Route[]> = {
|
||||
export const routeModel: Record<Auth.RoleType, AuthRoute.Route[]> = {
|
||||
super: [
|
||||
{
|
||||
name: 'dashboard',
|
||||
@ -844,5 +844,3 @@ const routes: Record<Auth.RoleType, AuthRoute.Route[]> = {
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export default routes;
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
interface ModelUser {
|
||||
userId: string;
|
||||
userName: string;
|
||||
password: string;
|
||||
role: Auth.RoleType;
|
||||
}
|
||||
|
||||
const users: ModelUser[] = [
|
||||
{
|
||||
userId: '0',
|
||||
userName: 'Soybean',
|
||||
password: 'soybean',
|
||||
role: 'super'
|
||||
},
|
||||
{
|
||||
userId: '1',
|
||||
userName: 'Super',
|
||||
password: 'super',
|
||||
role: 'super'
|
||||
},
|
||||
{
|
||||
userId: '2',
|
||||
userName: 'Admin',
|
||||
password: 'admin',
|
||||
role: 'admin'
|
||||
},
|
||||
{
|
||||
userId: '3',
|
||||
userName: 'User01',
|
||||
password: 'user01',
|
||||
role: 'user'
|
||||
}
|
||||
];
|
||||
|
||||
export default users;
|
||||
Reference in New Issue
Block a user