Explorar el Código

perf: 登录后获取permissions

xingyu hace 2 años
padre
commit
db223d50d3
Se han modificado 2 ficheros con 6 adiciones y 2 borrados
  1. 5 2
      mock/user/index.ts
  2. 1 0
      src/api/login/types.ts

+ 5 - 2
mock/user/index.ts

@@ -10,18 +10,21 @@ const List: {
   password: string
   role: string
   roleId: string
+  permissions: string | string[]
 }[] = [
   {
     username: 'admin',
     password: 'admin',
     role: 'admin',
-    roleId: '1'
+    roleId: '1',
+    permissions: '*.*.*'
   },
   {
     username: 'test',
     password: 'test',
     role: 'test',
-    roleId: '2'
+    roleId: '2',
+    permissions: ['example:dialog:create', 'example:dialog:delete']
   }
 ]
 

+ 1 - 0
src/api/login/types.ts

@@ -8,4 +8,5 @@ export type UserType = {
   password: string
   role: string
   roleId: string
+  permissions: string | string[]
 }