diff --git a/src/utils/request.ts b/src/utils/request.ts index b9c5474ec..f035decef 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -1,5 +1,6 @@ import axios from 'axios'; import { message as $message } from 'ant-design-vue'; +import { uniqueSlash } from './urlUtils'; import type { AxiosRequestConfig } from 'axios'; import { ACCESS_TOKEN_KEY } from '@/enums/cacheEnum'; import { Storage } from '@/utils/Storage'; @@ -113,7 +114,7 @@ export const request = async ( return $message.error('你没有访问该接口的权限,请联系管理员!'); } const fullUrl = `${(isMock ? baseMockUrl : baseApiUrl) + config.url}`; - config.url = fullUrl.replace(/(? path.replace(/(? path.replace(/(https?:\/)|(\/)+/g, '$1$2'); +// Safari 不支持以下正则(反向否定查找) shit! +// export const uniqueSlash = (path: string) => path.replace(/(?