Browse Source

fix lint error & login style

Michael Wang 3 năm trước cách đây
mục cha
commit
2d625e7a4a

+ 0 - 27
public/styles/style.css

@@ -549,37 +549,10 @@ select, input[type="text"]:focus, input[type="password"]:focus {
 	position: relative;
 	padding: 10px 0;
 }
-.login div span {
-	position: absolute;
-	top: 22px;
-	right: -35px;
-	display: block;
-	width: 16px;
-	height: 16px;
-	overflow: hidden;
-}
-.login div span.success {
-	background: url(../img/success_small.png) no-repeat 0 0;
-}
-.login div span.error {
-	background: url(../img/error_small.png) no-repeat 0 0;
-}
 .login input,.login select {
 	width: 320px;
 	height: 40px;
 }
-.login select {
-	background: url(../img/select.png) no-repeat scroll right center transparent;
- 	-moz-appearance:none;
- 	-webkit-appearance:none;
-	appearance:none;
-	padding-right: 25px;
-	color: #647992;
-}
-.login select option {
-	color: #647992!important;
-}
-.login select::-ms-expand { display: none; }
 .login a {
 	display: block;
 	height: 50px;

+ 1 - 2
src/features/Image/Image.vue

@@ -143,7 +143,7 @@
 
 <script setup lang="ts">
 import { store } from "@/store";
-import { computed, onMounted, ref } from "vue";
+import { computed, ref } from "vue";
 import { useRouter } from "vue-router";
 const router = useRouter();
 
@@ -179,7 +179,6 @@ const chooseDirectory = () => {
       }
     });
 };
-onMounted(async () => {});
 
 const start = () => {
   store.pageInputs["/image-download"] = {

+ 1 - 1
src/features/ImageDownload/ImageDownload.vue

@@ -54,7 +54,7 @@
 
 <script setup lang="ts">
 import { store } from "@/store";
-import { computed, onMounted, ref } from "vue";
+import { onMounted, ref } from "vue";
 import { useRouter } from "vue-router";
 const router = useRouter();
 import { getStudents, countStudents } from "@/api/api";

+ 14 - 32
src/features/Login/Login.vue

@@ -45,11 +45,6 @@ import { login } from "@/api/api";
 import { useRouter } from "vue-router";
 const router = useRouter();
 
-// Object.assign(
-//   window.electron.env,
-//   JSON.parse(window.localStorage.getItem("env") || "{}")
-// );
-
 let server = ref(null);
 const servers = store.config.servers.map((v) => {
   return { label: v.name, value: v.host };
@@ -58,6 +53,7 @@ const servers = store.config.servers.map((v) => {
 let loginName = ref("");
 let password = ref("");
 
+// FIXME: restore original state
 // onMounted(() => {
 //   window.localStorage.clear();
 // });
@@ -66,45 +62,31 @@ loginName.value = "admin-test";
 password.value = "123456";
 
 const loginAction = () => {
-  // window.electron.env.server = server.value;
-
-  // window.electron.env.loginName = loginName.value;
-  // window.electron.env.password = password.value;
   Object.assign(store.env, {
     server: store.config.servers.find((v) => v.host === server.value),
     loginName: loginName.value,
     password: password.value,
   });
-  // if (window.electron.env.server == undefined) {
-  //   alert("请选择服务地址");
-  //   return;
-  // }
-  // if (window.electron.env.loginName == "") {
-  //   alert("请输入账号");
-  //   return;
-  // }
-  // if (window.electron.env.password == "") {
-  //   alert("请输入密码");
-  //   return;
-  // }
+  if (!server.value) {
+    alert("请选择服务地址");
+    return;
+  }
+  if (!loginName.value) {
+    alert("请输入账号");
+    return;
+  }
+  if (!password.value) {
+    alert("请输入密码");
+    return;
+  }
   login()
     .then((res) => {
-      console.log(res.data);
       Object.assign(store.env.user, res.data);
-      window.localStorage.setItem("env", JSON.stringify(store.env));
-      // window.location.href = 'exam-list.html'
       router.push("/exam-list");
     })
     .catch((err) => {
+      console.log(err);
       alert("登陆失败,用户名或密码错误");
     });
 };
-// console.log(window.electron.api);
-
-// await window.electron.api.doIt(
-//   "/Users/michael/Documents/qmth/electron-exam-shell/package.json"
-// );
-// console.log("ene");
-
-// setInterval(() => window.electron.printStore(), 3000);
 </script>

+ 1 - 0
src/features/SyncRun/SyncRun.vue

@@ -60,6 +60,7 @@ onMounted(async () => {
     let pageNumber = 0;
 
     status.value = "正在下载考生...";
+    // eslint-disable-next-line
     while (true) {
       pageNumber++;
       const array = (

+ 7 - 24
src/router/index.ts

@@ -4,54 +4,37 @@ const routes: Array<RouteRecordRaw> = [
   {
     path: "/",
     name: "Login",
-    component: () =>
-      import(
-        /* webpackChunkName: "about" */ "../views/features/Login/Login.vue"
-      ),
+    component: () => import("../features/Login/Login.vue"),
   },
   {
     path: "/home",
     name: "Home",
-    component: () =>
-      import(/* webpackChunkName: "about" */ "../views/features/Home/Home.vue"),
+    component: () => import("../features/Home/Home.vue"),
   },
   {
     path: "/exam-list",
     name: "ExamList",
-    component: () =>
-      import(
-        /* webpackChunkName: "about" */ "../views/features/ExamList/ExamList.vue"
-      ),
+    component: () => import("../features/ExamList/ExamList.vue"),
   },
   {
     path: "/image",
     name: "Image",
-    component: () =>
-      import(
-        /* webpackChunkName: "about" */ "../views/features/Image/Image.vue"
-      ),
+    component: () => import("../features/Image/Image.vue"),
   },
   {
     path: "/image-download",
     name: "ImageDownload",
-    component: () =>
-      import(
-        /* webpackChunkName: "about" */ "../views/features/ImageDownload/ImageDownload.vue"
-      ),
+    component: () => import("../features/ImageDownload/ImageDownload.vue"),
   },
   {
     path: "/sync",
     name: "Sync",
-    component: () =>
-      import(/* webpackChunkName: "about" */ "../views/features/Sync/Sync.vue"),
+    component: () => import("../features/Sync/Sync.vue"),
   },
   {
     path: "/sync-run",
     name: "SyncRun",
-    component: () =>
-      import(
-        /* webpackChunkName: "about" */ "../views/features/SyncRun/SyncRun.vue"
-      ),
+    component: () => import("../features/SyncRun/SyncRun.vue"),
   },
 ];