5 changed files with 67 additions and 64 deletions
@ -1,40 +1,43 @@ |
|||
/** |
|||
* 自动生成 API |
|||
* 负责调用后端接口 |
|||
*/ |
|||
|
|||
import { requestClient } from '#/api/request'; |
|||
import { useAppConfig } from '@vben/hooks'; |
|||
|
|||
export namespace UserApi { |
|||
export namespace userApi { |
|||
|
|||
/** |
|||
* 分页查询 |
|||
*/ |
|||
export function page(params:any){ |
|||
return requestClient.get('/api/user/page',{params}); |
|||
} |
|||
const applicationConfig = useAppConfig(import.meta.env, import.meta.env.PROD); |
|||
|
|||
console.log('=== 接口域名 ===', applicationConfig.javaURL + '/health-user/page') |
|||
/** |
|||
* 详情 |
|||
* 分页查询 |
|||
*/ |
|||
export function detail(id:number){ |
|||
return requestClient.get('/api/user/'+id); |
|||
export function page(params: any) { |
|||
return requestClient.post(applicationConfig.javaURL + '/health-user/page', params , |
|||
{ headers: {'Content-Type': 'application/json', Token: 'ded93460-0cf5-45db-81ae-7608dbd3f51e', version: '1.0.1'} }); |
|||
} |
|||
|
|||
/** |
|||
* 新增 |
|||
* 获取详情 |
|||
*/ |
|||
export function add(data:any){ |
|||
return requestClient.post('/api/user',data); |
|||
export function get(id: number) { |
|||
return requestClient.get(applicationConfig.javaURL + '/health_user/' + id); |
|||
} |
|||
|
|||
/** |
|||
* 更新 |
|||
* 新增 / 修改 |
|||
*/ |
|||
export function update(id:number,data:any){ |
|||
return requestClient.put('/api/user/'+id,data); |
|||
export function save(data: any) { |
|||
return requestClient.post(applicationConfig.javaURL + '/health_user', data); |
|||
} |
|||
|
|||
/** |
|||
* 删除 |
|||
*/ |
|||
export function remove(id:number){ |
|||
return requestClient.delete('/api/user/'+id); |
|||
export function remove(id: number) { |
|||
return requestClient.delete(applicationConfig.javaURL + '/health_user/' + id); |
|||
} |
|||
|
|||
} |
|||
|
|||
Loading…
Reference in new issue