You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
881 B

import Http from '~~/utils/http';
import {PaginationVo, ResOptions} from "~~/api/types";
export default new class Common extends Http<ResOptions<any>> {
private readonly upload = '/common/upload'
private readonly caseList = '/cases/lists'
private readonly bottomMenu = '/index/bottomMenu'
private readonly search_url = '/index/search'
private readonly login_url = '/user/login'
handleUpload(file: any) {
const formData = new FormData();
formData.append('file', file)
return this.post(this.upload, formData)
}
getCaseList(params: PaginationVo) {
return this.get(this.caseList, params)
}
getBottomMenu() {
return this.get(this.bottomMenu)
}
login(data: any) {
return this.post(this.login_url,this.toFormData(data))
}
searchApi(params: PaginationVo & {category_id?: number}){
return this.get(this.search_url, params)
}
}