enc-manager
Version:
enc-manager 核心组件.
60 lines (50 loc) • 1.9 kB
JavaScript
import AjmHttp from 'enc-framework/core/utils/ajm-http';
import AjmConfig from 'enc-framework/core/utils/ajm-config'
// http请求对象
let $http = new AjmHttp({contextPath: AjmConfig.get("MANAGER_CONTEXT_PATH")}).getHttpClient();
let resourceService = {
// 查询资源服务列表
findResourceListByPage (params) {
if (!params) {
params = {};
}
return $http.post('/api/resource/findResourceListByPage', params).then(res => res.data);
},
findResourceNodeList(params){
if(!params){
params = {};
}
return $http.post('/api/resource/findResourceTree', params).then(res => res.data);
},
// 删除资源节点
deleteResourceByResourceId(params){
return $http.get('/api/resource/deleteResourceByResourceId/' + params).then(res => res.data);
},
//保存或更新资源
saveOrUpdateResource(params){
return $http.post('/api/resource/saveOrUpdate', params).then(res => res.data);
},
//获取已经被使用的资源列表
findUsedResourceList(params){
return $http.post('/api/resource/findUsedResourceList/' + params).then(res => res.data);
},
//获取所有系统
findAllSystemList(params){
if(!params){
params = {};
}
return $http.post('/api/system/findAllSystemList', params).then(res => res.data);
},
//通过父ID获取资源列表树/api/resource/findResourceList
findResourceList(params){
if(!params){
params = {};
}
return $http.post('/api/resource/findResourceList', params).then(res => res.data);
},
//通过资源ID获取资源名称
findResourceByResourceId(resourceId){
return $http.get('/api/resource/findResourceByResourceId/' + resourceId).then(res => res.data);
},
}
export default resourceService;