From 4bcc4850dc431595e2c96a8d6a8333ec99dfcee8 Mon Sep 17 00:00:00 2001 From: ivamp Date: Fri, 26 Jul 2024 19:06:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20auth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 2 + .eslintrc.js | 2 + package.json | 2 + src/auto-imports.d.ts | 18 +++---- src/components.d.ts | 5 +- src/components/AppFooter.vue | 6 +-- src/components/HelloWorld.vue | 20 ++++---- src/layouts/app.vue | 73 +++++++++++++++++++++++++++ src/pages/auth/callback.vue | 33 ++++++++++++ src/pages/auth/login.vue | 54 ++++++++++++++++++++ src/plugins/README.md | 3 -- src/typed-router.d.ts | 4 +- yarn.lock | 95 +++++++++++++++++++++++++++++++++++ 13 files changed, 286 insertions(+), 31 deletions(-) create mode 100644 src/layouts/app.vue create mode 100644 src/pages/auth/callback.vue create mode 100644 src/pages/auth/login.vue delete mode 100644 src/plugins/README.md diff --git a/.editorconfig b/.editorconfig index 7053c49..e839fa5 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,3 +3,5 @@ indent_style = space indent_size = 2 trim_trailing_whitespace = true insert_final_newline = true + +# prettier diff --git a/.eslintrc.js b/.eslintrc.js index d0c3acb..018fed1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -13,8 +13,10 @@ module.exports = { 'vuetify', '@vue/eslint-config-typescript', './.eslintrc-auto-import.json', + 'plugin:prettier/recommended' ], rules: { 'vue/multi-word-component-names': 'off', }, + } diff --git a/package.json b/package.json index 5aa9bac..62cf0e7 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,9 @@ }, "dependencies": { "@mdi/font": "7.4.47", + "axios": "^1.7.2", "core-js": "^3.37.1", + "eslint-plugin-prettier": "^5.2.1", "roboto-fontface": "*", "vue": "^3.4.31", "vuetify": "^3.6.11" diff --git a/src/auto-imports.d.ts b/src/auto-imports.d.ts index 7c9f508..d32df24 100644 --- a/src/auto-imports.d.ts +++ b/src/auto-imports.d.ts @@ -55,8 +55,8 @@ declare global { const useCssModule: typeof import('vue')['useCssModule'] const useCssVars: typeof import('vue')['useCssVars'] const useLink: typeof import('vue-router')['useLink'] - const useRoute: typeof import('vue-router')['useRoute'] - const useRouter: typeof import('vue-router')['useRouter'] + const useRoute: typeof import('vue-router/auto')['useRoute'] + const useRouter: typeof import('vue-router/auto')['useRouter'] const useSlots: typeof import('vue')['useSlots'] const watch: typeof import('vue')['watch'] const watchEffect: typeof import('vue')['watchEffect'] @@ -93,8 +93,6 @@ declare module 'vue' { readonly nextTick: UnwrapRef readonly onActivated: UnwrapRef readonly onBeforeMount: UnwrapRef - readonly onBeforeRouteLeave: UnwrapRef - readonly onBeforeRouteUpdate: UnwrapRef readonly onBeforeUnmount: UnwrapRef readonly onBeforeUpdate: UnwrapRef readonly onDeactivated: UnwrapRef @@ -123,9 +121,8 @@ declare module 'vue' { readonly useAttrs: UnwrapRef readonly useCssModule: UnwrapRef readonly useCssVars: UnwrapRef - readonly useLink: UnwrapRef - readonly useRoute: UnwrapRef - readonly useRouter: UnwrapRef + readonly useRoute: UnwrapRef + readonly useRouter: UnwrapRef readonly useSlots: UnwrapRef readonly watch: UnwrapRef readonly watchEffect: UnwrapRef @@ -155,8 +152,6 @@ declare module '@vue/runtime-core' { readonly nextTick: UnwrapRef readonly onActivated: UnwrapRef readonly onBeforeMount: UnwrapRef - readonly onBeforeRouteLeave: UnwrapRef - readonly onBeforeRouteUpdate: UnwrapRef readonly onBeforeUnmount: UnwrapRef readonly onBeforeUpdate: UnwrapRef readonly onDeactivated: UnwrapRef @@ -185,9 +180,8 @@ declare module '@vue/runtime-core' { readonly useAttrs: UnwrapRef readonly useCssModule: UnwrapRef readonly useCssVars: UnwrapRef - readonly useLink: UnwrapRef - readonly useRoute: UnwrapRef - readonly useRouter: UnwrapRef + readonly useRoute: UnwrapRef + readonly useRouter: UnwrapRef readonly useSlots: UnwrapRef readonly watch: UnwrapRef readonly watchEffect: UnwrapRef diff --git a/src/components.d.ts b/src/components.d.ts index f8bd205..36531c7 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -1,13 +1,14 @@ /* eslint-disable */ -/* prettier-ignore */ // @ts-nocheck // Generated by unplugin-vue-components // Read more: https://github.com/vuejs/core/pull/3399 export {} +/* prettier-ignore */ declare module 'vue' { export interface GlobalComponents { - HelloWorld: typeof import('./src/components/HelloWorld.vue')['default'] + AppFooter: typeof import('./components/AppFooter.vue')['default'] + HelloWorld: typeof import('./components/HelloWorld.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] } diff --git a/src/components/AppFooter.vue b/src/components/AppFooter.vue index e7c5df3..d73cc65 100644 --- a/src/components/AppFooter.vue +++ b/src/components/AppFooter.vue @@ -1,13 +1,13 @@