const ajax = axios.create({ baseURL: 'https://shop.h888.fun/admin', withCredentials: true, timeout: 5000 }) export const request = (url, method='GET', params={}, config={}) => { method = method.toUpperCase() switch (method) { case 'GET': return ajax.get(url, {params, ...config}) case 'POST': return ajax.post(url, params, config) default: return ajax.get(url, {params, ...config}) } }