From 7841e706f64fbb9a96ec54f798250d679b5493db Mon Sep 17 00:00:00 2001 From: ZhouXY108 Date: Fri, 30 Dec 2022 01:56:26 +0800 Subject: [PATCH] commit code. --- .env | 1 + .env.development | 1 + .env.prod | 1 + .eslintrc.cjs | 16 ++-- .prettierrc.json | 6 +- env.d.ts | 7 ++ src/App.vue | 18 ++-- src/api/account.ts | 10 +++ src/layouts/MainPage/MainPage.vue | 22 ++--- src/layouts/MainPage/components/Logo.vue | 8 +- src/layouts/MainPage/components/MenuVO.ts | 82 +++++++++---------- src/layouts/MainPage/components/SiderMenu.vue | 64 +++++++-------- src/main.ts | 44 ++++++---- src/router/index.ts | 22 ++--- src/stores/account.ts | 16 ++-- src/type/PrincipalType.ts | 4 +- src/type/commands/LoginCommands.ts | 14 ++++ src/utils/auth.ts | 3 + src/utils/request.ts | 69 ++++++++++++++++ .../{index.vue => ChangePassword.vue} | 8 +- ...LoginByOTP.vue => ChangePasswordByOTP.vue} | 50 ++++++----- ...sword.vue => ChangePasswordByPassword.vue} | 52 ++++++------ src/views/Login/Login.vue | 8 +- src/views/Login/components/LoginByOTP.vue | 55 ++++++------- .../Login/components/LoginByPassword.vue | 60 +++++++------- vite.config.ts | 10 +-- 26 files changed, 378 insertions(+), 273 deletions(-) create mode 100644 .env create mode 100644 .env.development create mode 100644 .env.prod create mode 100644 src/api/account.ts create mode 100644 src/type/commands/LoginCommands.ts create mode 100644 src/utils/auth.ts rename src/views/ChangePassword/{index.vue => ChangePassword.vue} (70%) rename src/views/ChangePassword/components/{LoginByOTP.vue => ChangePasswordByOTP.vue} (83%) rename src/views/ChangePassword/components/{LoginByPassword.vue => ChangePasswordByPassword.vue} (79%) diff --git a/.env b/.env new file mode 100644 index 0000000..e4d9a04 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +VITE_TOKEN_NAME=plusone diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..e92978f --- /dev/null +++ b/.env.development @@ -0,0 +1 @@ +VITE_BASE_API=http://localhost:8108 diff --git a/.env.prod b/.env.prod new file mode 100644 index 0000000..70dbc55 --- /dev/null +++ b/.env.prod @@ -0,0 +1 @@ +VITE_BASE_API=http://api.plusone.zhouxy.xyz:8108 diff --git a/.eslintrc.cjs b/.eslintrc.cjs index f57cc3b..3ca2150 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,18 +1,18 @@ /* eslint-env node */ -require('@rushstack/eslint-patch/modern-module-resolution') +require("@rushstack/eslint-patch/modern-module-resolution"); module.exports = { root: true, extends: [ - 'plugin:vue/vue3-essential', - 'eslint:recommended', - '@vue/eslint-config-typescript', - '@vue/eslint-config-prettier', + "plugin:vue/vue3-essential", + "eslint:recommended", + "@vue/eslint-config-typescript", + "@vue/eslint-config-prettier", ], parserOptions: { - ecmaVersion: 'latest', + ecmaVersion: "latest", }, rules: { - 'vue/multi-word-component-names': 'off', + "vue/multi-word-component-names": "off", }, -} +}; diff --git a/.prettierrc.json b/.prettierrc.json index e16d48f..5740008 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,8 +1,8 @@ { - "singleQuote": true, - "semi": false, + "singleQuote": false, + "semi": true, "useTabs": false, "tabWidth": 4, "printWidth": 110, "endOfLine": "lf" -} \ No newline at end of file +} diff --git a/env.d.ts b/env.d.ts index 11f02fe..3f0c03f 100644 --- a/env.d.ts +++ b/env.d.ts @@ -1 +1,8 @@ /// + +declare interface Window { + $message: any; + $notification: any; + $dialog: any; + $loadingBar: any; +} diff --git a/src/App.vue b/src/App.vue index 928da52..0bf0fed 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,23 +1,21 @@ diff --git a/src/api/account.ts b/src/api/account.ts new file mode 100644 index 0000000..8ef46fb --- /dev/null +++ b/src/api/account.ts @@ -0,0 +1,10 @@ +import type { LoginByPasswordCommand } from "@/type/commands/LoginCommands"; +import http from "@/utils/request"; + +export function loginByPassword(loginByPasswordCommand: LoginByPasswordCommand) { + return http({ + url: "/login/byPassword", + method: "post", + data: loginByPasswordCommand, + }); +} diff --git a/src/layouts/MainPage/MainPage.vue b/src/layouts/MainPage/MainPage.vue index 272e9d7..5eec5ec 100644 --- a/src/layouts/MainPage/MainPage.vue +++ b/src/layouts/MainPage/MainPage.vue @@ -3,7 +3,7 @@
- {{ dark ? '亮色' : '暗色' }} + {{ dark ? "亮色" : "暗色" }} 颐和园路
@@ -36,31 +36,31 @@