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;