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.
60 lines
1.7 KiB
60 lines
1.7 KiB
/**
|
|
* 自动生成 API
|
|
* 负责调用后端接口
|
|
*/
|
|
|
|
import { requestClient } from '#/api/request';
|
|
import { useAppConfig } from '@vben/hooks';
|
|
import { useAccessStore } from '@vben/stores';
|
|
|
|
export namespace userApi {
|
|
|
|
const applicationConfig = useAppConfig(import.meta.env, import.meta.env.PROD);
|
|
console.log('=== 接口域名 ===', applicationConfig.javaURL)
|
|
|
|
/**
|
|
* 分页查询
|
|
*/
|
|
export function page(params: any) {
|
|
return requestClient.post(applicationConfig.javaURL+'/health-user/page', params,
|
|
{ headers: {'Content-Type': 'application/json', Token: useAccessStore().accessToken, version: '1.0.1'}});
|
|
}
|
|
|
|
/**
|
|
* 获取详情
|
|
*/
|
|
export function get(id: number) {
|
|
return requestClient.get(applicationConfig.javaURL+'/health-user/' + id);
|
|
}
|
|
|
|
/**
|
|
* 新增
|
|
*/
|
|
export function add(data: any) {
|
|
return requestClient.post(applicationConfig.javaURL+'/health-user/add', data,
|
|
{ headers: {'Content-Type': 'application/json', Token: 'ded93460-0cf5-45db-81ae-7608dbd3f51e', version: '1.0.1'}});
|
|
}
|
|
|
|
/**
|
|
* 修改
|
|
*/
|
|
export function save(data: any) {
|
|
return requestClient.post(applicationConfig.javaURL+'/health-user/modify', data,
|
|
{ headers: {'Content-Type': 'application/json', Token: 'ded93460-0cf5-45db-81ae-7608dbd3f51e', version: '1.0.1'}});
|
|
}
|
|
|
|
/**
|
|
* 删除
|
|
*/
|
|
export function remove(id: number) {
|
|
return requestClient.delete(applicationConfig.javaURL+'/health-user/' + id);
|
|
}
|
|
|
|
/**
|
|
* 枚举列表
|
|
*/
|
|
export function enumList(params: any) {
|
|
return requestClient.post(applicationConfig.javaURL+'/health-enums/optionList', params,{ headers: {'Content-Type': 'application/json', Token: 'ded93460-0cf5-45db-81ae-7608dbd3f51e', version: '1.0.1'}});
|
|
}
|
|
|
|
}
|
|
|