1.0.4 • Published 2 years ago
@keenoho/js-request v1.0.4
js-lib
请求库, 直接引入文件, 不进行编译打包.
例子:
import { Request } from '@keenoho/js-request'
function processHeader() {
const { user } = store.getState();
return {
'Content-Type': 'application/json;charset=UTF-8',
'X-SESSION-ID': xxxxx,
};
}
const requestService = new Request({
axiosConfig,
processHeader,
});
export const postMethod = requestService.postMethod.bind(requestService);
export const getMethod = requestService.getMethod.bind(requestService);