From 1bf2e174dd8dad359fe5ddb959722811e812f50d Mon Sep 17 00:00:00 2001 From: smail Date: Sat, 5 Sep 2026 11:13:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=80=E5=8F=91=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E4=B8=8E=E8=AE=A4=E8=AF=81=E9=87=8D=E8=AF=95=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fe/README.md | 8 ++++++++ fe/src/stores/useGlobalStatusStore.js | 3 +++ fe/vite.config.js | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/fe/README.md b/fe/README.md index 1d9f0d8..cc1a153 100644 --- a/fe/README.md +++ b/fe/README.md @@ -12,6 +12,14 @@ yarn yarn dev ``` +开发代理默认连接本机 HTTPS 后端 `https://127.0.0.1:443`。如果后端使用其他地址,请在 `fe/.env.development` 中设置: + +```env +VITE_DEV_BACKEND_URL=https://127.0.0.1:443 +``` + +自签名证书仅用于本地开发,代理不会校验证书链;生产环境应使用有效证书。 + ### Compile and Minify for Production ```sh diff --git a/fe/src/stores/useGlobalStatusStore.js b/fe/src/stores/useGlobalStatusStore.js index 5ed10ed..5766239 100644 --- a/fe/src/stores/useGlobalStatusStore.js +++ b/fe/src/stores/useGlobalStatusStore.js @@ -91,6 +91,7 @@ const useGlobalStatusStore = defineStore("useGlobalStatusStore", { this.authChecked = true; this.authStatus = AUTH_STATUS.UNAUTHENTICATED; this.authError = ""; + this.clearAuthRetryPath(); }, setUser(payload, resetPrompt = false) { const previousAccount = this.userInfos?.account || ""; @@ -114,11 +115,13 @@ const useGlobalStatusStore = defineStore("useGlobalStatusStore", { this.authChecked = true; this.authStatus = AUTH_STATUS.NEEDS_SETUP; this.authError = ""; + this.clearAuthRetryPath(); }, resetAuthAvailability() { this.authChecked = false; this.authStatus = AUTH_STATUS.UNKNOWN; this.authError = ""; + this.clearAuthRetryPath(); }, setAuthRetryPath(path) { this.authRetryPath = typeof path === "string" && path ? path : "/"; diff --git a/fe/vite.config.js b/fe/vite.config.js index 8214121..81bc3a9 100644 --- a/fe/vite.config.js +++ b/fe/vite.config.js @@ -9,7 +9,7 @@ import vue from '@vitejs/plugin-vue' // https://vitejs.dev/config/ export default defineConfig(({ mode }) => { const env = loadEnv(mode, process.cwd(), '') - const backendUrl = (env.VITE_DEV_BACKEND_URL || 'http://127.0.0.1:9001').replace(/\/$/, '') + const backendUrl = (env.VITE_DEV_BACKEND_URL || 'https://127.0.0.1:443').replace(/\/$/, '') return { plugins: [