接口返回

yanzili 3 years ago
parent f0a3a95cee
commit 4026dd06fa

@ -12,7 +12,7 @@ const service = axios.create({
// request拦截器
service.interceptors.request.use(
config => {
config.headers['Authorization'] = (getToken() == null || getToken() == undefined) ? '': getToken()
config.headers['Authorization'] = (getToken() == null || getToken() == undefined) ? '' : getToken()
return config
},
error => {
@ -29,7 +29,7 @@ service.interceptors.response.use(
* code为非20000是抛错 可结合自己业务进行修改
*/
const res = response.data
if (res.code !== 20000) {
if (res.code !== '200') {
Message({
message: res.message,
type: 'error',

Loading…
Cancel
Save