Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DA-Platform
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
文档服务地址:
http://47.92.0.57:3000/
周报索引地址:
http://47.92.0.57:3000/s/NruNXRYmV
Open sidebar
Berlin
DA-Platform
Commits
38d583fb
Commit
38d583fb
authored
Jul 31, 2020
by
李严凡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拦截bug删除
parent
08d12859
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
main.js
DAPlatform-front/src/main.js
+17
-17
No files found.
DAPlatform-front/src/main.js
View file @
38d583fb
...
...
@@ -32,23 +32,23 @@ axios.interceptors.response.use(function (response) {
// 对响应错误做点什么
return
Promise
.
reject
(
error
)
})
//添加请求拦截器,每次请求设置都请求cookie信息
axios
.
interceptors
.
request
.
use
(
function
(
config
){
let
token
=
localStorage
.
getItem
(
"vuex"
)
//获取vuex的全局变量
// console.log(localStorage)
// console.log(token)
//如果vuex的全局变量userInfo为空值
if
(
token
==
NULL
){
ElementUI
.
Message
({
type
:
"warning"
,
message
:
"您未登录,请前往登录界面进行操作"
})
window
.
location
.
href
=
'/#/'
}
return
config
},
function
(
error
){
return
Promise
.
reject
(
error
)
})
//
添加请求拦截器,每次请求设置都请求cookie信息
//
axios.interceptors.request.use(function(config){
//
let token = localStorage.getItem("vuex")//获取vuex的全局变量
//
// console.log(localStorage)
//
// console.log(token)
//
//如果vuex的全局变量userInfo为空值
// if(token == "undefined"
){
//
ElementUI.Message({
//
type:"warning",
//
message:"您未登录,请前往登录界面进行操作"
//
})
//
window.location.href = '/#/'
//
}
//
return config
//
},function(error){
//
return Promise.reject(error)
//
})
Vue
.
use
(
VueAxios
,
axios
)
Vue
.
use
(
ElementUI
)
...
...
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