Procházet zdrojové kódy

feat: 一些优化

zhangjie před 1 rokem
rodič
revize
bf02e28cff

+ 1 - 1
electron/db/models/dict.ts

@@ -27,7 +27,7 @@ class Dict extends Model<
 Dict.init(
   {
     id: {
-      type: DataTypes.INTEGER.UNSIGNED,
+      type: DataTypes.INTEGER,
       autoIncrement: true,
       primaryKey: true,
     },

+ 1 - 1
electron/db/models/trackTask.ts

@@ -33,7 +33,7 @@ class TrackTask extends Model<
 TrackTask.init(
   {
     id: {
-      type: DataTypes.INTEGER.UNSIGNED,
+      type: DataTypes.INTEGER,
       autoIncrement: true,
       primaryKey: true,
     },

+ 2 - 2
electron/db/models/trackTaskDetail.ts

@@ -38,12 +38,12 @@ class TrackTaskDetail extends Model<
 TrackTaskDetail.init(
   {
     id: {
-      type: DataTypes.INTEGER.UNSIGNED,
+      type: DataTypes.INTEGER,
       autoIncrement: true,
       primaryKey: true,
     },
     trackTaskId: {
-      type: DataTypes.INTEGER.UNSIGNED,
+      type: DataTypes.INTEGER,
       allowNull: false,
     },
     studentName: {

+ 0 - 1
electron/main/index.ts

@@ -17,7 +17,6 @@ function createWindow(): void {
     webPreferences: {
       preload: join(__dirname, '../preload/index.js'),
       sandbox: false,
-      webSecurity: false,
     },
   });
 

+ 4 - 0
src/router/guard/userLoginInfo.ts

@@ -9,19 +9,23 @@ export default function setupUserLoginInfoGuard(router: Router) {
     const userStore = useUserStore();
     if (!to.meta.requiresAuth) {
       next();
+      NProgress.done();
       return;
     }
     if (userStore.accessToken) {
       next();
+      NProgress.done();
     } else {
       if (to.name === 'Login') {
         next();
+        NProgress.done();
         return;
       }
 
       next({
         name: 'Login',
       });
+      NProgress.done();
     }
   });
 }

+ 1 - 1
src/store/modules/app/index.ts

@@ -3,7 +3,7 @@ import { AppState } from './types';
 
 const useAppStore = defineStore('app', {
   state: (): AppState => ({
-    version: '',
+    version: '1.0.0',
     domain: '',
     device: 'desktop',
   }),

+ 5 - 6
src/views/login/login/index.vue

@@ -40,13 +40,12 @@
           </a-input>
         </a-form-item>
         <a-form-item field="password">
-          <a-input
+          <a-input-password
             v-model.trim="formData.password"
-            type="password"
             placeholder="请输入密码"
             allow-clear
           >
-          </a-input>
+          </a-input-password>
         </a-form-item>
         <a-form-item>
           <a-button type="primary" :loading="loading" long @click="submit"
@@ -82,10 +81,10 @@
 
   const formRef = ref<FormInstance>();
   const formData = reactive<LoginData>({
-    schoolCode: '',
+    schoolCode: 'test-school-1',
     type: 'ACCOUNT',
-    loginName: '',
-    password: '',
+    loginName: 'admin',
+    password: '12345678',
   });
 
   const rules: FormRules<keyof LoginData> = {