浏览代码

Merge branch 'startLogin' into dev

mo 2 年之前
父节点
当前提交
7f070e7b93
共有 2 个文件被更改,包括 8 次插入5 次删除
  1. 1 1
      dev-dist/sw.js
  2. 7 4
      src/views/login/components/pwdLogin.tsx

+ 1 - 1
dev-dist/sw.js

@@ -82,7 +82,7 @@ define(['./workbox-5357ef54'], (function (workbox) { 'use strict';
     "revision": "3ca0b8505b4bec776b69afdba2768812"
   }, {
     "url": "index.html",
-    "revision": "0.t3v686ag1j"
+    "revision": "0.vhi9vnjfui"
   }], {});
   workbox.cleanupOutdatedCaches();
   workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {

+ 7 - 4
src/views/login/components/pwdLogin.tsx

@@ -42,12 +42,15 @@ export default defineComponent({
     const showPwd = ref(false);
 
     const userStore = useUserStore();
-    const formInline = reactive({
+    let formInline = reactive({
       username: '',
       password: '',
       isCaptcha: true
     });
-
+    const formInlineHistory = storage.get("userInfo-teacher");
+    if (formInlineHistory) {
+      formInline = reactive({ ...JSON.parse(formInlineHistory) });
+    }
     const handleSubmit = async () => {
       formRef.value.validate(async (errors: any) => {
         if (!errors) {
@@ -69,9 +72,9 @@ export default defineComponent({
             message.destroyAll();
             //  判断是否勾选自动登录
             if (autoLogin.value) {
-              storage.set('userInfo', JSON.stringify(formInline));
+              storage.set('userInfo-teacher', JSON.stringify(formInline));
             } else {
-              storage.remove('userInfo');
+              storage.remove('userInfo-teacher');
             }
 
             // route.query?.redirect ||