define(["axios"], (axios) => { const instance = axios.create({ timeout: 10000 }); instance.interceptors.response.use((response) => { if (response.data.code != 200) { return Promise.reject(response.data); } return response.data; }, (err) => { return Promise.reject(err); }); const http = { get(path, params, options) { return instance.get(path, { ...options, params, }); }, post(path, data, options) { return instance.post(path, data, options); } }; return http; });