init
This commit is contained in:
parent
45254c3dc4
commit
ae2b72df4a
6
.env
6
.env
@ -1,8 +1,8 @@
|
|||||||
# port
|
# port
|
||||||
VITE_DEV_PORT = '8080'
|
VITE_DEV_PORT = '8083'
|
||||||
|
|
||||||
# development path
|
# development path
|
||||||
VITE_DEV_PATH = 'https://demo.mtruning.club'
|
VITE_DEV_PATH = 'http://127.0.0.1:8787'
|
||||||
|
|
||||||
# production path
|
# production path
|
||||||
VITE_PRO_PATH = 'https://demo.mtruning.club'
|
VITE_PRO_PATH = 'http://127.0.0.1:8787'
|
10297
package-lock.json
generated
Normal file
10297
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -9,16 +9,17 @@ import {
|
|||||||
} from '@/enums/httpEnum'
|
} from '@/enums/httpEnum'
|
||||||
import type { RequestGlobalConfigType, RequestConfigType } from '@/store/modules/chartEditStore/chartEditStore.d'
|
import type { RequestGlobalConfigType, RequestConfigType } from '@/store/modules/chartEditStore/chartEditStore.d'
|
||||||
|
|
||||||
export const get = <T = any>(url: string, params?: object) => {
|
|
||||||
return axiosInstance<T>({
|
export const get = (url: string, params?: object) => {
|
||||||
|
return axiosInstance({
|
||||||
url: url,
|
url: url,
|
||||||
method: RequestHttpEnum.GET,
|
method: RequestHttpEnum.GET,
|
||||||
params: params,
|
params: params,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const post = <T = any>(url: string, data?: object, headersType?: string) => {
|
export const post = (url: string, data?: object, headersType?: string) => {
|
||||||
return axiosInstance<T>({
|
return axiosInstance({
|
||||||
url: url,
|
url: url,
|
||||||
method: RequestHttpEnum.POST,
|
method: RequestHttpEnum.POST,
|
||||||
data: data,
|
data: data,
|
||||||
@ -28,19 +29,8 @@ export const post = <T = any>(url: string, data?: object, headersType?: string)
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const patch = <T = any>(url: string, data?: object, headersType?: string) => {
|
export const put = (url: string, data?: object, headersType?: string) => {
|
||||||
return axiosInstance<T>({
|
return axiosInstance({
|
||||||
url: url,
|
|
||||||
method: RequestHttpEnum.PATCH,
|
|
||||||
data: data,
|
|
||||||
headers: {
|
|
||||||
'Content-Type': headersType || ContentTypeEnum.JSON
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export const put = <T = any>(url: string, data?: object, headersType?: ContentTypeEnum) => {
|
|
||||||
return axiosInstance<T>({
|
|
||||||
url: url,
|
url: url,
|
||||||
method: RequestHttpEnum.PUT,
|
method: RequestHttpEnum.PUT,
|
||||||
data: data,
|
data: data,
|
||||||
@ -50,8 +40,8 @@ export const put = <T = any>(url: string, data?: object, headersType?: ContentTy
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const del = <T = any>(url: string, params?: object) => {
|
export const del = (url: string, params?: object) => {
|
||||||
return axiosInstance<T>({
|
return axiosInstance({
|
||||||
url: url,
|
url: url,
|
||||||
method: RequestHttpEnum.DELETE,
|
method: RequestHttpEnum.DELETE,
|
||||||
params
|
params
|
||||||
@ -67,9 +57,6 @@ export const http = (type?: RequestHttpEnum) => {
|
|||||||
case RequestHttpEnum.POST:
|
case RequestHttpEnum.POST:
|
||||||
return post
|
return post
|
||||||
|
|
||||||
case RequestHttpEnum.PATCH:
|
|
||||||
return patch
|
|
||||||
|
|
||||||
case RequestHttpEnum.PUT:
|
case RequestHttpEnum.PUT:
|
||||||
return put
|
return put
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user