You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
472 B

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})
}
}