import { request } from 'umi' ; import config from '@/config' ; import { IComponentSchema } from '@/types/schema' ; const HOST = config . api ; export async function getCategoryList ( data , form ) { return request ( `${ HOST }/category/list` , { method : 'post' , data : { ... data , ... form , } , } ) ; } export async function addCategory ( data ) { return request ( `${ HOST }/category/add` , { method : 'post' , data , } ) ; } export async function editCategory ( data ) { return request ( `${ HOST }/category/edit` , { method : 'post' , data , } ) ; } export async function deleteCategory ( data ) { return request ( `${ HOST }/category/delete` , { method : 'post' , data , } ) ; } export async function queryAllWithComponent ( ) { return request ( `${ HOST }/category/queryAllWithComponent` , { method : 'post' , } ) ; } export async function addComponent ( data ) { return request ( `${ HOST }/component/add` , { method : 'post' , data , } ) ; } export async function queryComponentDetail ( data ) { return request ( `${ HOST }/component/detail` , { method : 'post' , data , } ) ; } export async function editComponent ( data ) { return request ( `${ HOST }/component/edit` , { method : 'post' , data , } ) ; } export async function deleteComponent ( data ) { return request ( `${ HOST }/component/delete` , { method : 'post' , data , } ) ; } export async function addPage ( data ) { return request ( `${ HOST }/page/add` , { method : 'post' , data , } ) ; } export async function editPage ( data ) { return request ( `${ HOST }/page/edit` , { method : 'post' , data , } ) ; } export async function queryPageDetail ( data ) { return request ( `${ HOST }/page/detail` , { method : 'post' , data , } ) ; } export async function queryPageList ( data ) { return request ( `${ HOST }/page/list` , { method : 'post' , data , } ) ; } export async function deletePage ( data ) { return request ( `${ HOST }/page/delete` , { method : 'post' , data , } ) ; } export async function togglePageTemplate ( data ) { return request ( `${ HOST }/page/togglePageTemplate` , { method : 'post' , data , } ) ; }