@jdlinker/linker
Version:
jdLinker 系统模块
54 lines (37 loc) • 2.15 kB
text/typescript
import { defHttp } from '@jdlinker/func';
// 更新全部菜单
export const updateMenus = (data: any) => defHttp.put({ url: `/menu/iot/_all`, data });
// 添加角色
export const addRole = (data: any) => defHttp.post({ url: `/role`, data });
//更新权限菜单
export const getRoleMenu = (id: string) => defHttp.get({ url: `/menu/role/${id}/_grant/tree` });
//更新权限菜单
export const updateRoleMenu = (id: string, data: any) => defHttp.put({ url: `/menu/role/${id}/_grant`, data });
// 记录初始化
// export const saveInit = () => defHttp.post({url:`/user/settings/init`,{ init: true }})
//获取初始化
export const getInit = () => defHttp.get({ url: `/user/settings/init` });
// 获取当前系统权限信息
export const getSystemPermission = () => defHttp.get({ url: `/system/resources/permission` });
// 保存基础信息
export const save = (data?: any) => defHttp.post({ url: '/system/config/scope/_save', data });
// 查询对应协议下的本地端口数据
export const getResourcesCurrent = () => defHttp.get({ url: '/network/resources/alive/_current' });
// 保存网络组件
export const saveNetwork = (data: any) => defHttp.post({ url: `/network/config`, data });
// 保存协议
export const saveProtocol = () => defHttp.post({ url: `/protocol/default-protocol/_save` });
// 新增设备接入网关
export const saveAccessConfig = (data: any) => defHttp.post({ url: `/gateway/device`, data });
// 新增产品
export const saveProduct = (data: any) => defHttp.post({ url: `/device/product`, data });
// 新增设备
export const saveDevice = (data: any) => defHttp.post({ url: `/device/instance`, data });
// 启用设备
export const deployDevice = (deviceId: string, params?: any) =>
defHttp.post({ url: `/device-instance/${deviceId}/deploy`, params });
export const changeDeploy = (id: string) => defHttp.post({ url: `/device-product/${id}/deploy` });
// 查询保存后的数据
export const detail = (data?: any) => defHttp.post({ url: `/system/config/scopes`, data });
// 获取协议
export const getProtocol = () => defHttp.get({ url: `/protocol/_query/no-paging?paging=false` });