refactor(projects): axios封装:文件夹规范,错误处理完善

This commit is contained in:
Soybean
2021-11-22 18:31:57 +08:00
parent c81221efac
commit 451c7547af
10 changed files with 88 additions and 46 deletions

View File

@@ -1,5 +1,8 @@
import { createRequest } from './axios';
import { REQUEST_TIMEOUT, REQUEST_TIMEOUT_MSG } from './config';
export const adminRequest = createRequest({
baseURL: import.meta.env.VITE_HTTP_URL_EMOSS_ADMIN as string
export const request = createRequest({
baseURL: import.meta.env.VITE_HTTP_URL,
timeout: REQUEST_TIMEOUT,
timeoutErrorMessage: REQUEST_TIMEOUT_MSG
});