axios-normal-response
v1.0.2
Published
A Normal HTTP Handle Plugin for axios
Downloads
3
Readme
axios-normal-response
Install
$ npm i axios-normal-response --save
Usage
import normalResponse 'axios-normal-response';
// optional custom code msg map, example: options = { responseCodeMsg: { 401: '禁止访问', 404: '未知资源' } }
normalResponse.setResponseCodeMsg(options);
axios.interceptors.response.use(normalResponse.succResponseHandle,
normalResponse.errResponseHandle);
Example
Questions & Suggestions
Please open an issue here.