|
@@ -50,7 +50,7 @@ public class SysProfileController extends BaseController
|
|
|
@GetMapping()
|
|
|
public String profile(ModelMap mmap)
|
|
|
{
|
|
|
- SysUser user = ShiroUtils.getSysUser();
|
|
|
+ SysUser user = getSysUser();
|
|
|
mmap.put("user", user);
|
|
|
mmap.put("roleGroup", userService.selectUserRoleGroup(user.getUserId()));
|
|
|
mmap.put("postGroup", userService.selectUserPostGroup(user.getUserId()));
|
|
@@ -61,7 +61,7 @@ public class SysProfileController extends BaseController
|
|
|
@ResponseBody
|
|
|
public boolean checkPassword(String password)
|
|
|
{
|
|
|
- SysUser user = ShiroUtils.getSysUser();
|
|
|
+ SysUser user = getSysUser();
|
|
|
if (passwordService.matches(user, password))
|
|
|
{
|
|
|
return true;
|
|
@@ -72,7 +72,7 @@ public class SysProfileController extends BaseController
|
|
|
@GetMapping("/resetPwd")
|
|
|
public String resetPwd(ModelMap mmap)
|
|
|
{
|
|
|
- SysUser user = ShiroUtils.getSysUser();
|
|
|
+ SysUser user = getSysUser();
|
|
|
mmap.put("user", userService.selectUserById(user.getUserId()));
|
|
|
return prefix + "/resetPwd";
|
|
|
}
|
|
@@ -82,7 +82,7 @@ public class SysProfileController extends BaseController
|
|
|
@ResponseBody
|
|
|
public AjaxResult resetPwd(String oldPassword, String newPassword)
|
|
|
{
|
|
|
- SysUser user = ShiroUtils.getSysUser();
|
|
|
+ SysUser user = getSysUser();
|
|
|
if (!passwordService.matches(user, oldPassword))
|
|
|
{
|
|
|
return error("修改密码失败,旧密码错误");
|
|
@@ -96,7 +96,7 @@ public class SysProfileController extends BaseController
|
|
|
user.setPwdUpdateDate(DateUtils.getNowDate());
|
|
|
if (userService.resetUserPwd(user) > 0)
|
|
|
{
|
|
|
- ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));
|
|
|
+ setSysUser(userService.selectUserById(user.getUserId()));
|
|
|
return success();
|
|
|
}
|
|
|
return error("修改密码异常,请联系管理员");
|
|
@@ -108,7 +108,7 @@ public class SysProfileController extends BaseController
|
|
|
@GetMapping("/edit")
|
|
|
public String edit(ModelMap mmap)
|
|
|
{
|
|
|
- SysUser user = ShiroUtils.getSysUser();
|
|
|
+ SysUser user = getSysUser();
|
|
|
mmap.put("user", userService.selectUserById(user.getUserId()));
|
|
|
return prefix + "/edit";
|
|
|
}
|
|
@@ -119,7 +119,7 @@ public class SysProfileController extends BaseController
|
|
|
@GetMapping("/avatar")
|
|
|
public String avatar(ModelMap mmap)
|
|
|
{
|
|
|
- SysUser user = ShiroUtils.getSysUser();
|
|
|
+ SysUser user = getSysUser();
|
|
|
mmap.put("user", userService.selectUserById(user.getUserId()));
|
|
|
return prefix + "/avatar";
|
|
|
}
|
|
@@ -132,7 +132,7 @@ public class SysProfileController extends BaseController
|
|
|
@ResponseBody
|
|
|
public AjaxResult update(SysUser user)
|
|
|
{
|
|
|
- SysUser currentUser = ShiroUtils.getSysUser();
|
|
|
+ SysUser currentUser = getSysUser();
|
|
|
currentUser.setUserName(user.getUserName());
|
|
|
currentUser.setEmail(user.getEmail());
|
|
|
currentUser.setPhonenumber(user.getPhonenumber());
|
|
@@ -149,7 +149,7 @@ public class SysProfileController extends BaseController
|
|
|
}
|
|
|
if (userService.updateUserInfo(currentUser) > 0)
|
|
|
{
|
|
|
- ShiroUtils.setSysUser(userService.selectUserById(currentUser.getUserId()));
|
|
|
+ setSysUser(userService.selectUserById(currentUser.getUserId()));
|
|
|
return success();
|
|
|
}
|
|
|
return error();
|
|
@@ -163,7 +163,7 @@ public class SysProfileController extends BaseController
|
|
|
@ResponseBody
|
|
|
public AjaxResult updateAvatar(@RequestParam("avatarfile") MultipartFile file)
|
|
|
{
|
|
|
- SysUser currentUser = ShiroUtils.getSysUser();
|
|
|
+ SysUser currentUser = getSysUser();
|
|
|
try
|
|
|
{
|
|
|
if (!file.isEmpty())
|
|
@@ -172,7 +172,7 @@ public class SysProfileController extends BaseController
|
|
|
currentUser.setAvatar(avatar);
|
|
|
if (userService.updateUserInfo(currentUser) > 0)
|
|
|
{
|
|
|
- ShiroUtils.setSysUser(userService.selectUserById(currentUser.getUserId()));
|
|
|
+ setSysUser(userService.selectUserById(currentUser.getUserId()));
|
|
|
return success();
|
|
|
}
|
|
|
}
|