mirror of https://github.com/certd/certd
chore:
parent
023f2d4569
commit
ccdc933064
|
@ -145,7 +145,7 @@ export function createAxiosService({ logger }: { logger: Logger }) {
|
|||
} else {
|
||||
logger.info("http response status:", response?.status);
|
||||
}
|
||||
if (response?.config?.returnResponse) {
|
||||
if (response?.config?.returnOriginRes) {
|
||||
return response;
|
||||
}
|
||||
return response.data;
|
||||
|
@ -215,7 +215,7 @@ export type HttpRequestConfig<D = any> = {
|
|||
logParams?: boolean;
|
||||
logRes?: boolean;
|
||||
httpProxy?: string;
|
||||
returnResponse?: boolean;
|
||||
returnOriginRes?: boolean;
|
||||
} & AxiosRequestConfig<D>;
|
||||
export type HttpClient = {
|
||||
request<D = any, R = any>(config: HttpRequestConfig<D>): Promise<HttpClientResponse<R>>;
|
||||
|
|
|
@ -36,7 +36,7 @@ function createService() {
|
|||
return response;
|
||||
}
|
||||
//@ts-ignore
|
||||
if (response.config.returnResponse) {
|
||||
if (response.config.returnOriginRes) {
|
||||
return response;
|
||||
}
|
||||
// dataAxios 是 axios 返回数据中的 data
|
||||
|
|
|
@ -58,7 +58,7 @@ export class Dns51Client {
|
|||
method: "get",
|
||||
withCredentials: true,
|
||||
logRes: false,
|
||||
returnResponse: true,
|
||||
returnOriginRes: true,
|
||||
headers: {
|
||||
// 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.95 Safari/537.36',
|
||||
'Origin': 'https://www.51dns.com',
|
||||
|
@ -90,7 +90,7 @@ export class Dns51Client {
|
|||
},
|
||||
withCredentials: true,
|
||||
logRes: false,
|
||||
returnResponse: true,
|
||||
returnOriginRes: true,
|
||||
headers: {
|
||||
'Origin': 'https://www.51dns.com',
|
||||
'Referer': 'https://www.51dns.com',
|
||||
|
@ -117,7 +117,7 @@ export class Dns51Client {
|
|||
method: 'get',
|
||||
withCredentials: true,
|
||||
logRes: false,
|
||||
returnResponse: true,
|
||||
returnOriginRes: true,
|
||||
headers: {
|
||||
// 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.95 Safari/537.36',
|
||||
'Origin': 'https://www.51dns.com',
|
||||
|
@ -144,7 +144,7 @@ export class Dns51Client {
|
|||
method: "get",
|
||||
withCredentials: true,
|
||||
logRes: false,
|
||||
returnResponse: true,
|
||||
returnOriginRes: true,
|
||||
headers: this.getRequestHeaders()
|
||||
});
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ export class UpyunClient {
|
|||
password: access.password
|
||||
},
|
||||
logRes: false,
|
||||
returnResponse: true
|
||||
returnOriginRes: true
|
||||
});
|
||||
if (res.data?.errors?.length > 0) {
|
||||
throw new Error(JSON.stringify(res.data.msg));
|
||||
|
|
Loading…
Reference in New Issue