|
|
@@ -1,25 +1,26 @@
|
|
|
import axiosInstance from './axios'
|
|
|
import { RequestHttpEnum, ContentTypeEnum } from '@/enums/httpEnum'
|
|
|
|
|
|
-export const get = (url: string) => {
|
|
|
+export const get = (url: string, params?: object) => {
|
|
|
return axiosInstance({
|
|
|
url: url,
|
|
|
method: RequestHttpEnum.GET,
|
|
|
+ params: params
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-export const post = (url: string, params: object, headersType?: string) => {
|
|
|
+export const post = (url: string, data?: object, headersType?: string) => {
|
|
|
return axiosInstance({
|
|
|
url: url,
|
|
|
method: RequestHttpEnum.POST,
|
|
|
- data: params,
|
|
|
+ data: data,
|
|
|
headers: {
|
|
|
'Content-Type': headersType || ContentTypeEnum.JSON
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-export const put = (url: string, data?: object, headersType?: string) => {
|
|
|
+export const put = (url: string, data?: object, headersType?: ContentTypeEnum) => {
|
|
|
return axiosInstance({
|
|
|
url: url,
|
|
|
method: RequestHttpEnum.PUT,
|
|
|
@@ -30,7 +31,7 @@ export const put = (url: string, data?: object, headersType?: string) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-export const del = (url: string, params: object) => {
|
|
|
+export const del = (url: string, params?: object) => {
|
|
|
return axiosInstance({
|
|
|
url: url,
|
|
|
method: RequestHttpEnum.DELETE,
|