Authored by zhengyouwei

send pwd with mail

... ... @@ -9,6 +9,7 @@ import com.ui.model.BaseResponse;
import com.ui.model.req.AuthModule;
import com.ui.model.req.PageRequest;
import com.ui.model.req.User;
import org.apache.commons.lang.RandomStringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -52,7 +53,7 @@ public class ManagerCtrl {
if (userAuthLocal.getUserByname(user.getName()) != null) {
return new BaseResponse(201, "用户已经存在");
}
user.setPwd(MD5Util.encryption("Yoho@9646"));
user.setPwd(RandomStringUtils.random(8,true,true));
baseResponse = httpRestClient.defaultPost(HttpUriContants.USER_INSERT, user, BaseResponse.class);
} else {
User u = (User) session.getAttribute("user");
... ...
... ... @@ -7,6 +7,7 @@ import com.ui.contants.HttpUriContants;
import com.ui.http.HttpRestClient;
import com.ui.model.BaseResponse;
import com.ui.model.req.User;
import org.apache.commons.lang.RandomStringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -75,7 +76,7 @@ public class UserCtrl {
model.addAttribute("message", "当前用户不存在");
return new ModelAndView("user/modifypwd");
}
user.setPwd(MD5Util.encryption(newpwd));
user.setPwd(RandomStringUtils.random(8,true,true));
httpRestClient.defaultPost(HttpUriContants.USER_UPDATE_PWD, user, BaseResponse.class);
userAuthLocal.flushUser(name);
return new ModelAndView("dashBoard/dashBoard");
... ... @@ -86,7 +87,7 @@ public class UserCtrl {
model.addAttribute("message", "旧密码错误");
return new ModelAndView("user/modifypwd");
}
user.setPwd(MD5Util.encryption(newpwd));
user.setPwd(newpwd);
httpRestClient.defaultPost(HttpUriContants.USER_UPDATE_PWD, user, BaseResponse.class);
session.removeAttribute("user");
userAuthLocal.flushUser(name);
... ...