Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcjg-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
2f686431
authored
2023-03-29 10:16:20 +0800
by
renchao@pashanhoo.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:request判断的完成
1 parent
5c31de25
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
public/config.json
src/utils/request.js
public/config.json
View file @
2f68643
{
"TITLE"
:
"汉中市数据上报系统"
,
"THEME"
:
"sb"
,
"CODE"
:
"BDC
JG
PT"
,
"CODE"
:
"BDC
SB
PT"
,
"SERVERAPI"
:
"/bdcsjsb"
,
"calcHeight"
:
160
,
"echartTextColor"
:
"#4A4A4A"
,
...
...
src/utils/request.js
View file @
2f68643
/*
* @Description: 此文件主要创建 axios 实例,然后添加请求拦截器和响应拦截器
* @Autor: renchao
* @LastEditTime: 2023-03-2
1 15:03:37
* @LastEditTime: 2023-03-2
9 10:14:34
*/
import
Vue
from
'vue'
import
axios
from
"axios"
;
import
{
Message
}
from
"element-ui"
;
import
{
endLoadingSubCount
}
from
"./requestLoading"
;
...
...
@@ -68,6 +69,15 @@ function handleErrorData (status) {
window
.
tokenValid
=
false
;
Message
.
error
(
"由于长时间未操作,请重新登录!"
);
localStorage
.
removeItem
(
"token"
);
let
code
=
Vue
.
prototype
.
BASE_API
.
CODE
if
(
code
==
'BDCSBPT'
)
{
router
.
replace
({
path
:
"/sb"
,
query
:
{
redirect
:
router
.
history
.
current
.
fullPath
,
},
});
}
else
{
router
.
replace
({
path
:
"/jg"
,
query
:
{
...
...
@@ -75,6 +85,8 @@ function handleErrorData (status) {
},
});
}
}
break
;
case
403
:
Message
.
error
(
"拒绝访问"
);
...
...
Please
register
or
sign in
to post a comment