| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import { defHttp } from '/@/utils/http/axios';
- enum Api {
- list = '/sys/dict/DeviceKind/query',
- save = '/sys/dict/DeviceKind/add',
- edit = '/sys/dict/DeviceKind/edit',
- // selectDevice = '/jeecg-system/sys/dict/DeviceKind/query',
- deleteById = '/sys/dict/DeviceKind/delete',
- // queryDevice = '/sys/dict/DeviceKind/query',
- password = '/ventanaly-device/safety/devicePwd/edit',
- passwordList = '/ventanaly-device/safety/devicePwd/queryByDeviceKind',
- }
- // /**
- // * 列表接口
- // * @param params
- // */
- // export const queryDeviceList = (params) => defHttp.get({ url: Api.queryDevice, params });
- /**
- * 列表接口
- * @param params
- */
- export const list = (params) => defHttp.get({ url: Api.list, params });
- /**
- * 设备类型查询接口
- * @param params
- */
- // export const selectDevice = (params) => defHttp.get({ url: Api.selectDevice, params });
- /**
- * 删除用户
- */
- export const deleteById = (params, handleSuccess) => {
- return defHttp.delete({ url: Api.deleteById, params }, { joinParamsToUrl: true }).then(() => {
- handleSuccess();
- });
- };
- /**
- * 保存或者更新用户
- * @param params
- */
- export const saveOrUpdate = (params, isUpdate) => {
- const url = isUpdate ? Api.edit : Api.save;
- return isUpdate ? defHttp.put({ url: url, params }) : defHttp.post({ url: url, params });
- };
- export const editPassword = (params) => defHttp.put({ url: Api.password, params });
- export const passwordList = (params) => defHttp.get({ url: Api.passwordList, params });
|