use of com.cdeledu.common.base.AjaxJson in project wechat by dllwh.
the class SysUserOperateController method clearRoleByUserIds.
/**
* @方法描述: 根据用户id清空角色
* @return
*/
@ResponseBody
@RequestMapping(value = "roleAssign", params = "clearRoleUser")
@SystemLog(desc = "用户-角色(解除授权)", opType = SysOpType.INSERT, tableName = "sys_user")
public AjaxJson clearRoleByUserIds(SysUserRole sysUserRole) {
AjaxJson resultMsg = new AjaxJson();
if (sysUserRole.getUserId() != null) {
if (WebUtilHelper.getCurrentUserId() != sysUserRole.getUserId()) {
try {
manageruserService.deleteUserRole(sysUserRole);
} catch (Exception e) {
e.printStackTrace();
resultMsg.setSuccess(false);
resultMsg.setResultCode(500);
resultMsg.setMsg(MessageConstant.MSG_OPERATION_FAILED);
}
} else {
resultMsg.setSuccess(false);
resultMsg.setResultCode(500);
resultMsg.setMsg("不能解除当前用户权限");
}
}
// 超级管理员不能删除
return resultMsg;
}
use of com.cdeledu.common.base.AjaxJson in project wechat by dllwh.
the class IconController method del.
/**
* @方法描述: 删除图标
* @创建者: 皇族灬战狼
* @创建时间: 2016年9月22日 下午2:25:30
* @param request
* @return
*/
@RequestMapping(params = "delIcon")
@ResponseBody
public AjaxJson del(HttpServletRequest request) {
AjaxJson result = new AjaxJson();
// 删除图标时先检查该图标是否正在使用
boolean isPermit = false;
if (isPermit) {
}
return result;
}
use of com.cdeledu.common.base.AjaxJson in project wechat by dllwh.
the class LoginController method resetPwd.
@ResponseBody
@RequestMapping(value = "resetPwd")
@SystemLog(desc = "重置密码", opType = SysOpType.UPDATE, tableName = "sys_user")
public AjaxJson resetPwd(String oldPassWord, String newPassWord) {
AjaxJson result = new AjaxJson();
SysUser currenLoginUser = ShiroHelper.getPrincipal();
// 判断用户是否为空,不为空,则清空session中的用户object
if (currenLoginUser != null) {
if (StringUtils.isNoneBlank(oldPassWord) && StringUtils.isNoneBlank(newPassWord)) {
String password = PasswordUtil.encrypt(currenLoginUser.getUserName(), oldPassWord.trim());
if (currenLoginUser.getPassword().equalsIgnoreCase(password)) {
SysUser sysUser = new SysUser();
sysUser.setId(currenLoginUser.getId());
sysUser.setPassword(PasswordUtil.encrypt(currenLoginUser.getUserName(), newPassWord.trim()));
try {
userService.update(sysUser);
result.setSuccess(true);
result.setMsg(MessageConstant.MSG_OPERATION_SUCCESS);
} catch (Exception e) {
e.printStackTrace();
result.setSuccess(false);
result.setMsg(MessageConstant.MSG_OPERATION_FAILED);
}
} else {
result.setSuccess(false);
result.setMsg("错误提示:请输入正确的原密码");
}
} else {
result.setSuccess(false);
result.setMsg("错误提示:旧密码或新密码不能为空");
}
} else {
result.setSuccess(false);
result.setMsg("当前用户尚未登录,请重新登录");
}
return result;
}
use of com.cdeledu.common.base.AjaxJson in project wechat by dllwh.
the class MenuOperateController method createMenu.
/**
* ----------------------------------------------------- Fields end
*/
@ResponseBody
@RequestMapping(value = "createMenu", method = RequestMethod.POST)
@SystemLog(desc = "创建权限菜单", opType = SysOpType.INSERT, tableName = "sys_menu")
public AjaxJson createMenu(ModelMap map, SysMenu menu) {
AjaxJson ajaxJson = new AjaxJson();
int resultCount = -1;
try {
if (menu.getType() == SysMenuType.BUTTON.getValue()) {
SysMenu parentmMenu = new SysMenu();
parentmMenu.setId(menu.getParentCode());
if (sysMenuService.findOneForJdbc(parentmMenu).getType() == SysMenuType.MENU.getValue()) {
resultCount = sysMenuService.insert(menu);
} else {
ajaxJson.setSuccess(false);
ajaxJson.setMsg("禁止为菜单目录创建按钮权限");
}
} else {
resultCount = sysMenuService.insert(menu);
}
if (resultCount == 1) {
// 分配给超级管理员
try {
roleService.saveRoleAccess(1, menu.getId());
} catch (Exception e) {
}
}
} catch (Exception e) {
ajaxJson.setSuccess(false);
ajaxJson.setMsg(MessageConstant.MSG_OPERATION_SUCCESS);
}
return ajaxJson;
}
use of com.cdeledu.common.base.AjaxJson in project wechat by dllwh.
the class MenuOperateController method delDisable.
@ResponseBody
@RequestMapping(value = "updateMenu", params = "delDisable")
@SystemLog(desc = "禁止删除菜单", opType = SysOpType.UPDATE, tableName = "sys_menu")
public AjaxJson delDisable(SysMenu sysMenu) {
AjaxJson ajaxJson = new AjaxJson();
ajaxJson.setMsg(MessageConstant.SUCCESS_ENABLE_FALSE);
return ajaxJson;
}
Aggregations