修复开发代理与认证重试状态
Some checks are pending
Security Checks / security (push) Waiting to run

This commit is contained in:
smail 2026-09-05 11:13:59 +08:00
parent 47614bff74
commit 1bf2e174dd
3 changed files with 12 additions and 1 deletions

View File

@ -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

View File

@ -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 : "/";

View File

@ -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: [