From 7b372de6d81647f5036fecf5f2ad2dbb692db67a Mon Sep 17 00:00:00 2001 From: hptangxi Date: Wed, 2 Jul 2025 20:44:30 +0800 Subject: [PATCH] login and auth --- web/eslint.config.js | 1 + web/src/App.vue | 8 ++++- web/src/{ => assets}/style.css | 13 +++---- web/src/components/Layout.vue | 14 ++++---- web/src/components/Logout.vue | 15 ++++---- web/src/components/NavBar.vue | 10 +++--- web/src/main.ts | 2 +- web/src/router/index.ts | 6 ++-- web/src/services/auth.ts | 62 +++++++++++++++++++++------------- web/src/utils/http.ts | 10 +++--- web/src/views/Dashboard.vue | 10 +++--- web/src/views/Login.vue | 49 +++++++++++++++------------ 12 files changed, 113 insertions(+), 87 deletions(-) rename web/src/{ => assets}/style.css (86%) diff --git a/web/eslint.config.js b/web/eslint.config.js index 0d2d561..5d1addf 100644 --- a/web/eslint.config.js +++ b/web/eslint.config.js @@ -52,6 +52,7 @@ export default [ "vue/multiline-html-element-content-newline": "off", "vue/html-indent": ["error", 2], "vue/script-indent": ["error", 2], + "vue/component-tags-order": ["error", { order: ["script", "template", "style"] }], // Vue 3 Composition API 规则 "vue/no-setup-props-destructure": "error", diff --git a/web/src/App.vue b/web/src/App.vue index e5b936c..fd635fa 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -1,12 +1,18 @@ diff --git a/web/src/style.css b/web/src/assets/style.css similarity index 86% rename from web/src/style.css rename to web/src/assets/style.css index c038d7e..e6b05cf 100644 --- a/web/src/style.css +++ b/web/src/assets/style.css @@ -9,20 +9,17 @@ -moz-osx-font-smoothing: grayscale; } -body { - margin: 0; - display: flex; - place-items: center; - min-width: 320px; - min-height: 100vh; +html, body { + height: 100%; } #app { max-width: 1280px; width: 100%; + padding: 20px; margin: 0 auto; - padding: 2rem; - min-height: 100vh; + height: 100%; + box-sizing: border-box; } .flex { diff --git a/web/src/components/Layout.vue b/web/src/components/Layout.vue index f92d791..78cce92 100644 --- a/web/src/components/Layout.vue +++ b/web/src/components/Layout.vue @@ -1,5 +1,10 @@ + + - -