Forráskód Böngészése

fix: Role修改为正确的定义

Jinyao 5 éve
szülő
commit
baa8eed031
3 módosított fájl, 3 hozzáadás és 3 törlés
  1. 1 1
      src/composable/useUser.ts
  2. 1 1
      src/store/modules/user.ts
  3. 1 1
      src/typings/project.d.ts

+ 1 - 1
src/composable/useUser.ts

@@ -6,7 +6,7 @@ export const useUser = () => {
   const store = useStore();
 
   const userInfo = computed(() => store.state.user);
-  const userLoggedIn = computed(() => store.state.user.role !== 'GUEST');
+  const userLoggedIn = computed(() => store.state.user.role !== '游客');
 
   const userLogOut = () => {
     UserDispatcher.userLogOut();

+ 1 - 1
src/store/modules/user.ts

@@ -7,7 +7,7 @@ const DEFAULT: UserState = {
   email: '',
   id: -1,
   phone: '',
-  role: 'GUEST',
+  role: '游客',
   withGitlab: false,
 };
 

+ 1 - 1
src/typings/project.d.ts

@@ -36,4 +36,4 @@ declare interface CommitRecord {
   title: string;
 }
 
-declare type Role = 'TEACHER' | 'STUDENT' | 'ADMIN' | 'GUEST';
+declare type Role = '教师' | '学生' | '管理员' | '游客';