Merge pull request '(#48) Core Api baseUrl param can be overridden' (#49) from dev-mrkbear into master

Reviewed-on: http://git.mrkbear.com/MrKBear/mini-dlpu-v3/pulls/49
This commit is contained in:
MrKBear 2022-01-20 16:11:42 +08:00
commit 1f24a59bd9

View File

@ -168,17 +168,18 @@ class API<
> { > {
/** /**
* URL *
* TODO: 这里可能涉及负载均衡
*/ */
public static get baseUrl():string {
return "https://jwc.nogg.cn";
}
public static defaultLogLabel:LogLabel = new LogLabel( public static defaultLogLabel:LogLabel = new LogLabel(
`API:API`, colorRadio(200, 120, 222) `API:API`, colorRadio(200, 120, 222)
); );
/**
* URL
* TODO: 这里可能涉及负载均衡
*/
public baseUrl: string = "https://jwc.nogg.cn";
/** /**
* Logger 使 * Logger 使
*/ */
@ -319,7 +320,7 @@ class API<
// 重置请求数据 // 重置请求数据
const requestData:IWxRequestOption<O> = this.requestData = { const requestData:IWxRequestOption<O> = this.requestData = {
url: API.baseUrl + this.url, url: this.baseUrl + this.url,
data: {}, header: {}, data: {}, header: {},
timeout: this.timeout, timeout: this.timeout,
method: this.method, method: this.method,