index.ts
476 Bytes
import { defHttp } from "@/utils/external/http/axios";
import { DictItem, UploadResponse } from "./model";
enum Api {
GET_DICT = '/dict_item',
UPLOAD = '/oss/upload'
}
export const getDictItemByCode = (value: string) => {
return defHttp.post<DictItem[]>({
url: `${Api.GET_DICT}/find`,
params: {
dictCode: value
}
})
}
export const upload = (file: FormData) => {
return defHttp.post<UploadResponse>({
url: Api.UPLOAD,
params: file
})
}