From a09a0eedd29fdc9a9bd5414bd12c08e37c72982a Mon Sep 17 00:00:00 2001 From: vben Date: Mon, 22 Feb 2021 23:04:47 +0800 Subject: [PATCH] perf: improve login logic --- package.json | 15 +- .../CountDown/src/CountdownInput.vue | 13 +- src/design/var/breakpoint.less | 23 +- src/hooks/component/useFormItem.ts | 2 +- src/hooks/web/useECharts.ts | 4 +- src/hooks/web/useHeight.ts | 13 - src/hooks/web/useI18n.ts | 23 +- src/hooks/web/useRect.ts | 33 -- .../header/components/user-dropdown/index.vue | 10 +- src/main.ts | 1 + src/router/constant.ts | 6 +- src/router/guard/httpGuard.ts | 4 + src/router/guard/messageGuard.ts | 4 + src/router/index.ts | 3 +- src/router/scrollBehavior.ts | 57 -- src/router/types.ts | 7 - src/store/index.ts | 11 +- src/utils/encryption/aesEncryption.ts | 4 +- src/views/sys/login/ForgetPasswordForm.vue | 75 +-- src/views/sys/login/Login.vue | 19 +- src/views/sys/login/LoginForm.vue | 27 +- src/views/sys/login/LoginFormTitle.vue | 35 ++ src/views/sys/login/MobileForm.vue | 65 ++- src/views/sys/login/QrCodeForm.vue | 38 +- src/views/sys/login/RegisterForm.vue | 120 +++-- src/views/sys/login/useLogin.ts | 39 +- tsconfig.json | 5 - windi.config.ts | 15 +- yarn.lock | 502 ++---------------- 29 files changed, 352 insertions(+), 821 deletions(-) delete mode 100644 src/hooks/web/useHeight.ts delete mode 100644 src/hooks/web/useRect.ts delete mode 100644 src/router/scrollBehavior.ts create mode 100644 src/views/sys/login/LoginFormTitle.vue diff --git a/package.json b/package.json index a75bfcd4..473f7b1e 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "log": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0", "clean:cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite", "clean:lib": "npx rimraf node_modules", - "typecheck": "vuedx-typecheck .", "lint:eslint": "eslint \"{src,mock}/**/*.{vue,ts,tsx}\" --fix", "lint:prettier": "prettier --write --loglevel warn \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"", "lint:stylelint": "stylelint --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/", @@ -27,7 +26,7 @@ }, "dependencies": { "@iconify/iconify": "^2.0.0-rc.6", - "@vueuse/core": "^4.1.1", + "@vueuse/core": "^4.2.1", "@zxcvbn-ts/core": "^0.2.0", "ant-design-vue": "2.0.0", "apexcharts": "^3.25.0", @@ -52,7 +51,7 @@ "devDependencies": { "@commitlint/cli": "^11.0.0", "@commitlint/config-conventional": "^11.0.0", - "@iconify/json": "^1.1.306", + "@iconify/json": "^1.1.307", "@ls-lint/ls-lint": "^1.9.2", "@purge-icons/generated": "^0.7.0", "@types/fs-extra": "^9.0.7", @@ -70,8 +69,6 @@ "@vitejs/plugin-vue": "^1.1.4", "@vitejs/plugin-vue-jsx": "^1.1.0", "@vue/compiler-sfc": "^3.0.5", - "@vuedx/typecheck": "^0.6.3", - "@vuedx/typescript-plugin-vue": "^0.6.3", "autoprefixer": "^10.2.4", "commitizen": "^4.2.3", "conventional-changelog-cli": "^2.1.1", @@ -84,7 +81,7 @@ "esno": "^0.4.4", "fs-extra": "^9.1.0", "http-server": "^0.12.3", - "husky": "^5.0.9", + "husky": "^5.1.0", "is-ci": "^3.0.0", "less": "^4.1.1", "lint-staged": "^10.5.4", @@ -100,14 +97,14 @@ "typescript": "^4.1.5", "vite": "2.0.1", "vite-plugin-compression": "^0.2.1", - "vite-plugin-html": "^2.0.0", + "vite-plugin-html": "^2.0.1", "vite-plugin-imagemin": "^0.2.7", "vite-plugin-mock": "^2.1.4", "vite-plugin-purge-icons": "^0.7.0", - "vite-plugin-pwa": "^0.5.2", + "vite-plugin-pwa": "^0.5.3", "vite-plugin-style-import": "^0.7.3", "vite-plugin-theme": "^0.4.3", - "vite-plugin-windicss": "0.4.3", + "vite-plugin-windicss": "0.4.4", "vue-eslint-parser": "^7.5.0", "yargs": "^16.2.0" }, diff --git a/src/components/CountDown/src/CountdownInput.vue b/src/components/CountDown/src/CountdownInput.vue index 1a0f1167..5635f40d 100644 --- a/src/components/CountDown/src/CountdownInput.vue +++ b/src/components/CountDown/src/CountdownInput.vue @@ -1,11 +1,9 @@