mirror of
https://github.com/talktao/Vue3-Vite-Vant-TS-H5.git
synced 2025-04-28 04:48:58 +08:00
add: 增加axios封装的注释
This commit is contained in:
parent
321109bbcf
commit
42065beebd
@ -16,12 +16,12 @@ class HttpRequest {
|
|||||||
private readonly withCredentials: boolean;
|
private readonly withCredentials: boolean;
|
||||||
private readonly timeout: number;
|
private readonly timeout: number;
|
||||||
constructor() {
|
constructor() {
|
||||||
|
//获取当前环境的api地址
|
||||||
this.baseURL = import.meta.env.VITE_BASE_URL as string;
|
this.baseURL = import.meta.env.VITE_BASE_URL as string;
|
||||||
console.log(this.baseURL,'this.baseURL');
|
|
||||||
|
|
||||||
this.withCredentials = true;
|
this.withCredentials = true;
|
||||||
this.timeout = 1000 * 60;
|
this.timeout = 1000 * 60;
|
||||||
}
|
}
|
||||||
|
//初始化get请求
|
||||||
getInitConfig(): AxiosRequestConfig {
|
getInitConfig(): AxiosRequestConfig {
|
||||||
return {
|
return {
|
||||||
baseURL: this.baseURL,
|
baseURL: this.baseURL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user