接口返回

yanzili 3 years ago
parent f0a3a95cee
commit 4026dd06fa

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

Loading…
Cancel
Save