From bec473e62a108af0c3bb6050112d798719294138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BF=97=E5=BC=BA?= <357099073@qq.com> Date: Mon, 26 Jan 2026 15:07:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E8=8E=B7?= =?UTF-8?q?=E5=8F=96user=5Finfo=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 2 -- .env.development | 2 +- .env.production | 2 +- src/stores/auth.js | 8 ++++---- src/views/dashboard/index.vue | 1 + 5 files changed, 7 insertions(+), 8 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 4e0dff2..0000000 --- a/.env +++ /dev/null @@ -1,2 +0,0 @@ -# 环境配置 -# VITE_API_BASE_URL=http://backapi.yunzer.cn diff --git a/.env.development b/.env.development index 26b8bb5..48d5ee3 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,3 @@ # 开发环境接口 # VITE_API_BASE_URL=http://localhost:8000 -VITE_API_BASE_URL=http://backend.yunzer.cn \ No newline at end of file +VITE_API_BASE_URL=https://backend.yunzer.cn \ No newline at end of file diff --git a/.env.production b/.env.production index 16113ca..252ad9d 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1,2 @@ # 生产环境接口 -VITE_API_BASE_URL=http://backend.yunzer.cn +VITE_API_BASE_URL=https://backend.yunzer.cn diff --git a/src/stores/auth.js b/src/stores/auth.js index 3975041..3f3080f 100644 --- a/src/stores/auth.js +++ b/src/stores/auth.js @@ -36,10 +36,10 @@ export const useAuthStore = defineStore('auth', () => { const userInfo = loginData.user || loginData const normalizedUser = { - id: parseInt(userInfo.id || userInfo.id) || null, - account: userInfo.account || userInfo.account, - name: userInfo.name || userInfo.name, - group_id: userInfo.group_id || userInfo.group_id, + id: parseInt(userInfo.id) || null, + account: userInfo.account || '', + name: userInfo.name || '', + group_id: userInfo.group_id || '', avatar: userInfo.avatar || '' } diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 14a4210..0c10ad3 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -356,6 +356,7 @@ onMounted(async () => { try { // 从auth store获取用户信息 const id = authStore.user.id; + console.log('用户ID:', id); if (!id) { console.error('用户ID不存在'); return;