123
This commit is contained in:
@@ -15,7 +15,6 @@ import { RequestOptions, Result, CreateAxiosOptions } from './types';
|
||||
|
||||
import { useUserStoreWidthOut } from '@/store/modules/user';
|
||||
import {domainStoreWidthOut} from "@/store/modules/domain";
|
||||
import {domainList} from "@/api/login";
|
||||
|
||||
const urlPrefix = '';
|
||||
|
||||
@@ -40,7 +39,9 @@ const transform: AxiosTransform = {
|
||||
isReturnNativeResponse,
|
||||
} = options;
|
||||
|
||||
if(res.request.responseURL.includes(domainList)){
|
||||
console.log(res.request.responseURL.endsWith('domain.txt'))
|
||||
console.log(res.request.responseURL)
|
||||
if(res.request.responseURL.includes('domain.txt')){
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -134,12 +135,18 @@ const transform: AxiosTransform = {
|
||||
}
|
||||
if(!isUrlStr){
|
||||
let domain = domainStoreWidthOut().getDomain;
|
||||
if(domain && domain.length > 0){
|
||||
if(config.url && config.url.endsWith("domain.txt")){
|
||||
return config
|
||||
}else if(domain && domain.length > 0){
|
||||
let domainUrl = domain[Math.floor((Math.random()*domain.length))];
|
||||
config.url = domainUrl + config.url;
|
||||
}else if(apiUrl && isString(apiUrl)){
|
||||
config.url = `${apiUrl}${config.url}`;
|
||||
}
|
||||
}else{
|
||||
if(config.url && config.url.endsWith("domain.txt")){
|
||||
return config
|
||||
}
|
||||
}
|
||||
// if (!isUrlStr && apiUrl && isString(apiUrl)) {
|
||||
// config.url = `${apiUrl}${config.url}`;
|
||||
|
||||
Reference in New Issue
Block a user