From 91837e1a684ba7ff6f1213c0b6ca6d41f5254c2c Mon Sep 17 00:00:00 2001 From: chenxf Date: Mon, 5 Jan 2026 15:59:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(user):=20=E4=BF=AE=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=99=BB=E5=87=BA=E6=97=B6=E7=9A=84=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改登出逻辑,将catch放在finally之前,确保无论成功或失败都会执行清理操作 feat(sidebar): 优化侧边栏组件的渲染逻辑 - 将JSX语法替换为createElement语法,提高代码兼容性 - 修复title属性绑定问题 chore(config): 调整年报服务地址配置 - 将生产环境中的年报服务地址设置为空字符串 - 保持与aiccs同域名同端口部署的一致性 --- .env.production | 2 +- src/layout/components/Sidebar/Item.vue | 9 ++++++++- src/store/modules/user.js | 6 +++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.env.production b/.env.production index 800702e..ab3a2a0 100644 --- a/.env.production +++ b/.env.production @@ -16,5 +16,5 @@ VUE_APP_CAS_SERVER_UNITE = 'http://10.194.188.69/cas' VUE_APP_AICEPS_URL = 'http://10.201.62.87:6891/gz-aiceps-manage' # 年报服务地址 无需写/aiceps-service-web 如和aiccs同域名同端口部署则置空 -VUE_APP_AICEPS_SERVICE_URL = 'http://219.148.175.144:56666' +VUE_APP_AICEPS_SERVICE_URL = '' diff --git a/src/layout/components/Sidebar/Item.vue b/src/layout/components/Sidebar/Item.vue index 8909f57..83de5fe 100644 --- a/src/layout/components/Sidebar/Item.vue +++ b/src/layout/components/Sidebar/Item.vue @@ -47,7 +47,14 @@ export default { // vnodes.push({(title)}) // } // } - vnodes.push({(title)}) + vnodes.push(h( + 'span', // 标签名 + { + slot: 'title', // slot 属性 + attrs: { title: title } // 动态绑定 title 属性(等价于 :title="title") + }, + title // 标签内容(等价于 {title}) + )) return vnodes } } diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 60b43c9..30b9f7c 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -92,13 +92,13 @@ const actions = { // user logout logout({ commit, state }) { return new Promise((resolve, reject) => { - logout().then(() => { + logout().catch(error => { + reject(error) + }).finally(() => { commit('SET_ROLES', []) removeToken() resetRouter() resolve() - }).catch(error => { - reject(error) }) }) },