UNPKG

enc-manager

Version:

enc-manager 核心组件.

60 lines (53 loc) 1.99 kB
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 userService = { //查询用户分页列表 findUserListByPage(params){ if(!params){ params = {}; } return $http.post('/api/user/findUserListByPage', params).then(res => res.data); }, //删除用户 deleteUserById(userId){ return $http.get("/api/user/deleteUserById/"+userId).then(res => res.data); }, //批量删除用户 batchDeleteUser(userIds){ if(!userIds){ userIds = []; } return $http.post("/api/user/deleteUserByIds/", userIds).then(res => res.data); }, //保存或更新用户 saveOrUpdateUser(params){ return $http.post('/api/user/saveOrUpdate', params).then(res => res.data); }, //根据用户Id查询角色列表 /*findRoleListByUserPermissionCode(permissionCode){ return $http.get("/api/user/findRoleListByUserPermissionCode/"+ permissionCode).then(res => res.data); },*/ findRoleListByUserId(userId){ return $http.get("/api/user/findRoleListByUserId/"+ userId).then(res => res.data); }, //检查用户名是否存在 checkUserName(userName){ return $http.get("/api/user/checkUserName?userName=" + userName).then(res => res.data); }, //检查用户是否修改密码/api/user/checkIsDefaultPassword checkIsDefaultPassword(){ return $http.get("/api/user/checkIsDefaultPassword").then(res => res.data); }, //重置密码 resetUserPwdByUserId(userId) { return $http.get('/api/user/resetPassword/' + userId).then(res => res.data); }, //用户解除锁定/api/user/unlockUser unlockUser(userId) { return $http.get("/api/user/unlockUser/" + userId).then(res => res.data); }, }; export default userService;