...
|
...
|
@@ -34,6 +34,11 @@ public class UserCtrl { |
|
|
return new ModelAndView("user/login");
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/toupdatePwd")
|
|
|
public ModelAndView toupdatePwd() {
|
|
|
return new ModelAndView("user/modifypwd");
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/login")
|
|
|
public ModelAndView toLogin(User user, HttpSession session, Model model) {
|
|
|
User u = userAuthLocal.getUserByname(user.getName());
|
...
|
...
|
@@ -64,7 +69,7 @@ public class UserCtrl { |
|
|
public ModelAndView updatePwd(String name, String oldpwd, String newpwd, HttpSession session, Model model) {
|
|
|
Object obj = session.getAttribute("user");
|
|
|
String username = String.valueOf(obj);
|
|
|
if ("admin".equals(username)) {
|
|
|
if ("admin".equals(username) && !"admin".equals(name)) {
|
|
|
User user = userAuthLocal.getUserByname(username);
|
|
|
if (user == null) {
|
|
|
model.addAttribute("message", "当前用户不存在");
|
...
|
...
|
@@ -73,7 +78,7 @@ public class UserCtrl { |
|
|
user.setPwd(MD5Util.encryption(newpwd));
|
|
|
httpRestClient.defaultPost(HttpUriContants.USER_UPDATE_PWD, user, BaseResponse.class);
|
|
|
userAuthLocal.flushUser(name);
|
|
|
return new ModelAndView("dashboard/toDashboard");
|
|
|
return new ModelAndView("dashboard/dashBoard");
|
|
|
|
|
|
} else if (name.equals(username)) {
|
|
|
User user = userAuthLocal.getUserByname(username);
|
...
|
...
|
|