Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
3a5d1a57
提交
3a5d1a57
authored
8月 20, 2021
作者:
无木
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: refresh failed while token invalid
修复当token失效时,刷新页面可能出现异常的问题 fixed: #1101
上级
2c867b3d
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
15 行增加
和
7 行删除
+15
-7
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
permissionGuard.ts
src/router/guard/permissionGuard.ts
+6
-1
user.ts
src/store/modules/user.ts
+6
-4
checkStatus.ts
src/utils/http/axios/checkStatus.ts
+2
-2
没有找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
3a5d1a57
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
-
**其它**
-
**其它**
-
修复部分封装组件在使用插槽时报错的问题
-
修复部分封装组件在使用插槽时报错的问题
-
修复
`useECharts`
的
`theme`
参数不起作用的问题
-
修复
`useECharts`
的
`theme`
参数不起作用的问题
-
修复
`Token`
失效时,按 F5 刷新页面可能会出现页面加载异常的问题
## 2.7.1(2021-08-16)
## 2.7.1(2021-08-16)
...
...
src/router/guard/permissionGuard.ts
浏览文件 @
3a5d1a57
...
@@ -72,7 +72,12 @@ export function createPermissionGuard(router: Router) {
...
@@ -72,7 +72,12 @@ export function createPermissionGuard(router: Router) {
// get userinfo while last fetch time is empty
// get userinfo while last fetch time is empty
if
(
userStore
.
getLastUpdateTime
===
0
)
{
if
(
userStore
.
getLastUpdateTime
===
0
)
{
await
userStore
.
getUserInfoAction
();
try
{
await
userStore
.
getUserInfoAction
();
}
catch
(
err
)
{
next
();
return
;
}
}
}
if
(
permissionStore
.
getIsDynamicAddedRoute
)
{
if
(
permissionStore
.
getIsDynamicAddedRoute
)
{
...
...
src/store/modules/user.ts
浏览文件 @
3a5d1a57
...
@@ -128,10 +128,12 @@ export const useUserStore = defineStore({
...
@@ -128,10 +128,12 @@ export const useUserStore = defineStore({
* @description: logout
* @description: logout
*/
*/
async
logout
(
goLogin
=
false
)
{
async
logout
(
goLogin
=
false
)
{
try
{
if
(
this
.
token
)
{
await
doLogout
();
try
{
}
catch
{
await
doLogout
();
console
.
log
(
'注销Token失败'
);
}
catch
{
console
.
log
(
'注销Token失败'
);
}
}
}
this
.
setToken
(
undefined
);
this
.
setToken
(
undefined
);
this
.
setSessionTimeout
(
false
);
this
.
setSessionTimeout
(
false
);
...
...
src/utils/http/axios/checkStatus.ts
浏览文件 @
3a5d1a57
...
@@ -28,9 +28,9 @@ export function checkStatus(
...
@@ -28,9 +28,9 @@ export function checkStatus(
// Jump to the login page if not logged in, and carry the path of the current page
// Jump to the login page if not logged in, and carry the path of the current page
// Return to the current page after successful login. This step needs to be operated on the login page.
// Return to the current page after successful login. This step needs to be operated on the login page.
case
401
:
case
401
:
errMessage
=
t
(
'sys.api.errMsg401'
);
userStore
.
setToken
(
undefined
);
errMessage
=
msg
||
t
(
'sys.api.errMsg401'
);
if
(
stp
===
SessionTimeoutProcessingEnum
.
PAGE_COVERAGE
)
{
if
(
stp
===
SessionTimeoutProcessingEnum
.
PAGE_COVERAGE
)
{
userStore
.
setToken
(
undefined
);
userStore
.
setSessionTimeout
(
true
);
userStore
.
setSessionTimeout
(
true
);
}
else
{
}
else
{
userStore
.
logout
(
true
);
userStore
.
logout
(
true
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论