Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
vue-flow-editor
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2023-11-30 18:14:26 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f442380ad795e0388b327bc85fd7a6c2361dc024
f442380a
1 parent
3d4b969f
fix
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletions
doc/axios.js
doc/axios.js
View file @
f442380
/*
* @Date: 2023-10-27 11:12:24
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-11-
21 15:23:46
* @LastEditTime: 2023-11-
30 18:12:27
* @FilePath: /vue-flow-editor/doc/axios.js
* @Description: 文件描述
*/
import
axios
from
'axios'
;
import
{
ElMessageBox
}
from
'element-plus'
axios
.
defaults
.
params
=
{
m
:
'mod'
,
...
...
@@ -38,6 +39,19 @@ axios.interceptors.request.use(
*/
axios
.
interceptors
.
response
.
use
(
response
=>
{
// 默认显示错误提示
response
.
data
.
show
=
true
;
if
(
response
.
data
.
msg
===
'登录失效'
)
{
ElMessageBox
.
alert
(
'登录失效!将跳转到登录页面。'
,
'温馨提示'
,
{
confirmButtonText
:
'确定'
,
callback
:
action
=>
{
// session 失效需要重新登录
if
(
action
===
'confirm'
)
{
window
.
parent
.
location
.
href
=
location
.
origin
+
'/admin/'
+
window
.
parent
.
location
.
search
;
}
}
});
}
return
response
;
},
error
=>
{
...
...
Please
register
or
login
to post a comment