Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
corporateCulture-qd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王立鹏
corporateCulture-qd
Commits
173706f0
Commit
173706f0
authored
Feb 28, 2026
by
lijiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【需求 20331】 perf: 优化续token操作
parent
098a3cea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
error.ts
src/utils/request/error.ts
+16
-7
No files found.
src/utils/request/error.ts
View file @
173706f0
...
...
@@ -10,7 +10,7 @@ import {
import
type
{
BackendServiceResult
,
RequestServiceError
}
from
'./types'
import
{
showErrorMsg
}
from
'@/utils/toast'
import
type
{
AxiosError
,
AxiosRequestConfig
,
AxiosResponse
}
from
'axios'
import
type
{
MessageHandler
}
from
'element-plus'
import
service
from
'./index'
import
{
useUserStore
}
from
'@/stores/user'
...
...
@@ -134,16 +134,25 @@ async function handleUnAuthorized(axiosError: AxiosError) {
await
promiseFlashing
return
service
.
request
(
axiosError
.
config
as
AxiosRequestConfig
)
}
catch
(
e
)
{
// 获取refreshToken接口报错
console
.
log
(
e
)
ElMessage
({
showClose
:
true
,
message
:
'重新获取token失败,请关闭标签页,重新打开'
,
type
:
'error'
,
duration
:
0
,
})
create401ErrorMsg
()
userStore
.
clearAllUserInfo
()
return
Promise
.
reject
(
e
)
}
finally
{
promiseFlashing
=
null
}
}
let
msgIns
:
MessageHandler
|
null
=
null
function
create401ErrorMsg
()
{
if
(
!
msgIns
)
{
msgIns
=
ElMessage
({
message
:
'重新获取token失败,请关闭标签页,重新打开'
,
type
:
'error'
,
duration
:
0
,
})
}
return
msgIns
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment