|
@ -18,7 +18,7 @@ service.interceptors.request.use( |
|
|
timestamp: timestamp, |
|
|
timestamp: timestamp, |
|
|
args: ps, |
|
|
args: ps, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let sign = signGenerator(signData); |
|
|
let sign = signGenerator(signData); |
|
|
(config.headers as any).sign = sign; |
|
|
(config.headers as any).sign = sign; |
|
|
(config.headers as any).timestamp = timestamp; |
|
|
(config.headers as any).timestamp = timestamp; |
|
@ -43,14 +43,18 @@ service.interceptors.response.use( |
|
|
(res: any) => { |
|
|
(res: any) => { |
|
|
|
|
|
|
|
|
let data = JSON.parse(res.data); |
|
|
let data = JSON.parse(res.data); |
|
|
|
|
|
|
|
|
|
|
|
if (data && data.code === 101) { |
|
|
|
|
|
store.setToken('') |
|
|
|
|
|
return data |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (data && data.code !== 0) { |
|
|
if (data && data.code !== 0) { |
|
|
notification.warning({ |
|
|
notification.warning({ |
|
|
message: data.msg |
|
|
message: data.msg |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
if (data && data.code === 101) { |
|
|
|
|
|
store.setToken('') |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return data; |
|
|
return data; |
|
|
}, |
|
|
}, |
|
|
error => { |
|
|
error => { |
|
|