From 9f65c46c8248518b7462dc4e0ced72b03fbefaa5 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 4 Feb 2022 18:13:31 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=90=8E=E5=8F=B0=20UI=20=E8=B6=85=E6=97=B6=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=90=8E=EF=BC=8C=E8=BF=94=E5=9B=9E=E7=99=BB=E9=99=86?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=97=B6=EF=BC=8C=E7=94=B1=E4=BA=8E=E6=9C=AA?= =?UTF-8?q?=E7=99=BB=E9=99=86=E5=8A=A0=E8=BD=BD=E4=B8=8D=E5=88=B0=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=EF=BC=8C=E5=AF=BC=E8=87=B4=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-local.yaml | 3 ++- yudao-ui-admin/src/store/modules/user.js | 14 ++++++++++++++ 更新日志.md | 3 +-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index 709ff0014..109fa3515 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -192,7 +192,8 @@ yudao: token-header: Authorization token-secret: abcdefghijklmnopqrstuvwxyz token-timeout: 1d - session-timeout: 30m +# session-timeout: 30m + session-timeout: 10s mock-enable: true mock-secret: test file: diff --git a/yudao-ui-admin/src/store/modules/user.js b/yudao-ui-admin/src/store/modules/user.js index 57472374e..1f868ff1e 100644 --- a/yudao-ui-admin/src/store/modules/user.js +++ b/yudao-ui-admin/src/store/modules/user.js @@ -91,6 +91,20 @@ const user = { GetInfo({ commit, state }) { return new Promise((resolve, reject) => { getInfo(state.token).then(res => { + // 没有 data 数据,赋予个默认值 + if (!res) { + res = { + data: { + roles: [], + user: { + id: '', + avatar: '', + userName: '' + } + } + } + } + res = res.data; // 读取 data 数据 const user = res.user const avatar = user.avatar === "" ? require("@/assets/images/profile.jpg") : user.avatar; diff --git a/更新日志.md b/更新日志.md index 1f957cbe1..b0d1f3343 100644 --- a/更新日志.md +++ b/更新日志.md @@ -12,8 +12,6 @@ * 升级 mybatis plus 最新版本,优化多租户的实现 * RedisKeyDefine 的发现机制 -*【修复】管理后台 UI 超时登录后,返回登陆界面时,由于未登陆加载不到字典数据,导致报错的问题 - ## [v1.4.0] 计划,预计 2022.02.28 发布 @@ -38,6 +36,7 @@ TODO 待统计 * 【修复】用户无权限访问 指定 API 时,未返回 FORBIDDEN 结果码 * 【修复】定时任务刷新本地缓存时,无租户上线文,导致查询报错 * 【修复】配置中心只加载了删除的配置 +* 【修复】管理后台 UI 超时登录后,返回登陆界面时,由于未登陆加载不到信息,导致报错的问题 ### 🔨 Dependency Upgrades