Commit c09129b9 by guojx

运维登录人手机号

parent c5210cb5
...@@ -406,7 +406,8 @@ public class EnterpriseController extends WebBaseController { ...@@ -406,7 +406,8 @@ public class EnterpriseController extends WebBaseController {
AuthcenterUserDetails loginUser = (AuthcenterUserDetails) SessionContextUtil.getUser(request) ; AuthcenterUserDetails loginUser = (AuthcenterUserDetails) SessionContextUtil.getUser(request) ;
String operationUserId = String.valueOf(loginUser.getId()); String operationUserId = String.valueOf(loginUser.getId());
//运维信息参数 //运维信息参数
String operationInfo = "&operationUserId=" + operationUserId + "&userName=" + URLEncoder.encode(loginUser.getRealName(), "UTF-8"); String operationInfo = "&operationUserId=" + operationUserId + "&userName=" + URLEncoder.encode(loginUser.getRealName(), "UTF-8")
+ "&userMobile=" + loginUser.getUserMobile();
String random = "ywLogin:" + UuidUtil.randomUUID(); String random = "ywLogin:" + UuidUtil.randomUUID();
RedisUtil.setCache(random, 1, 10L); RedisUtil.setCache(random, 1, 10L);
......
...@@ -182,7 +182,8 @@ public class LoginController extends WebBaseController { ...@@ -182,7 +182,8 @@ public class LoginController extends WebBaseController {
} }
} }
logger.info("登录商户={}",gicEnterpriseId); logger.info("登录商户={}",gicEnterpriseId);
String code = this.doLogin(wxEnterpriseId, gicEnterpriseId, loginPhoneNumber, "gic", response, null, null); String code = this.doLogin(wxEnterpriseId, gicEnterpriseId, loginPhoneNumber, "gic", response,
null, null, null);
if (StringUtils.isNotBlank(code)) { if (StringUtils.isNotBlank(code)) {
try { try {
response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code); response.sendRedirect(host+"/haoban-3/#/gic-error?errorCode="+code);
...@@ -201,7 +202,7 @@ public class LoginController extends WebBaseController { ...@@ -201,7 +202,7 @@ public class LoginController extends WebBaseController {
@IgnoreLogin @IgnoreLogin
@RequestMapping("yw-login") @RequestMapping("yw-login")
public HaobanResponse ywLogin(String wxEnterpriseId, String gicEnterpriseId, String random, public HaobanResponse ywLogin(String wxEnterpriseId, String gicEnterpriseId, String random,
HttpServletResponse response, String operationUserId, String userName) throws UnsupportedEncodingException { HttpServletResponse response, String operationUserId, String userName, String userMobile) throws UnsupportedEncodingException {
// 判断是否存在random // 判断是否存在random
Object o = RedisUtil.getCache(random); Object o = RedisUtil.getCache(random);
if (o == null) { if (o == null) {
...@@ -214,12 +215,12 @@ public class LoginController extends WebBaseController { ...@@ -214,12 +215,12 @@ public class LoginController extends WebBaseController {
if (StringUtils.isNotBlank(userName)) { if (StringUtils.isNotBlank(userName)) {
userName = URLDecoder.decode(userName, "UTF-8"); userName = URLDecoder.decode(userName, "UTF-8");
} }
logger.info("好办运维登录商户id={},超管手机={},运维信息:{}-{}", gicEnterpriseId, gicSuperPhone, operationUserId, userName); logger.info("好办运维登录商户id={},超管手机={},运维信息:{}-{}-{}", gicEnterpriseId, gicSuperPhone, operationUserId, userName, userMobile);
if (StringUtils.isBlank(gicSuperPhone)) { if (StringUtils.isBlank(gicSuperPhone)) {
return this.fail("商户超管的手机号未配置"); return this.fail("商户超管的手机号未配置");
} }
//运维单点登录信息:operationUserId userName : 运维realName //运维单点登录信息:operationUserId userName : 运维realName
String code = this.doLogin(wxEnterpriseId, gicEnterpriseId, gicSuperPhone, "yw", response, operationUserId, userName); String code = this.doLogin(wxEnterpriseId, gicEnterpriseId, gicSuperPhone, "yw", response, operationUserId, userName,userMobile);
if (StringUtils.isNotBlank(code)) { if (StringUtils.isNotBlank(code)) {
return this.fail(this.errMessage(code)); return this.fail(this.errMessage(code));
} }
...@@ -284,8 +285,10 @@ public class LoginController extends WebBaseController { ...@@ -284,8 +285,10 @@ public class LoginController extends WebBaseController {
//运维登录信息 //运维登录信息
String operationUserId = jsonObject.getString("operationUserId"); String operationUserId = jsonObject.getString("operationUserId");
String userName = jsonObject.getString("userName"); String userName = jsonObject.getString("userName");
String userMobile = jsonObject.getString("userMobile");
String errorCode = this.doLogin(wxEnterpriseId, gicEnterpriseId, loginPhoneNumber, "gic", response, operationUserId, userName); String errorCode = this.doLogin(wxEnterpriseId, gicEnterpriseId, loginPhoneNumber, "gic", response,
operationUserId, userName, userMobile);
if (StringUtils.isNotBlank(errorCode)) { if (StringUtils.isNotBlank(errorCode)) {
ModelAndView model = new ModelAndView( ModelAndView model = new ModelAndView(
new RedirectView("/haoban-3/#/gic-error?errorCode=" + errorCode, false, false)); new RedirectView("/haoban-3/#/gic-error?errorCode=" + errorCode, false, false));
...@@ -321,9 +324,9 @@ public class LoginController extends WebBaseController { ...@@ -321,9 +324,9 @@ public class LoginController extends WebBaseController {
// 登录逻辑 // 登录逻辑
private String doLogin(String wxEnterpriseId, String gicEnterpriseId, String loginPhoneNumber, String loginChannel, private String doLogin(String wxEnterpriseId, String gicEnterpriseId, String loginPhoneNumber, String loginChannel,
HttpServletResponse response, String operationUserId, String userName) { HttpServletResponse response, String operationUserId, String userName, String userMobile) {
//运维单点登录信息:operationUserId userName : 运维realName //运维单点登录信息:operationUserId userName : 运维realName
logger.info("doLogin={},{},{},{}",gicEnterpriseId,loginPhoneNumber, operationUserId, userName); logger.info("doLogin={},{},{},{},{}",gicEnterpriseId,loginPhoneNumber, operationUserId, userName, userMobile);
WxApplicationDTO application = wxApplicationApiService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId,2); WxApplicationDTO application = wxApplicationApiService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId,2);
if (null == application) { if (null == application) {
logger.info("登录企业应用 没授权!gicEnterpriseId:{}", gicEnterpriseId); logger.info("登录企业应用 没授权!gicEnterpriseId:{}", gicEnterpriseId);
...@@ -570,7 +573,7 @@ public class LoginController extends WebBaseController { ...@@ -570,7 +573,7 @@ public class LoginController extends WebBaseController {
*/ */
@RequestMapping("/gic-login-check") @RequestMapping("/gic-login-check")
@IgnoreLogin @IgnoreLogin
public ModelAndView gicLogin(String code, String hbEnt,String hbPage, String operationUserId, String userName) throws UnsupportedEncodingException { public ModelAndView gicLogin(String code, String hbEnt,String hbPage, String operationUserId, String userName, String userMobile) throws UnsupportedEncodingException {
logger.info("gic登录clerkId={},hbEnt={},operationUserId={},userName={}", code, hbEnt, operationUserId, userName); logger.info("gic登录clerkId={},hbEnt={},operationUserId={},userName={}", code, hbEnt, operationUserId, userName);
PowerClerkDTO clerkDTO = this.userService.haobanLoginBack(code); PowerClerkDTO clerkDTO = this.userService.haobanLoginBack(code);
if (clerkDTO == null) { if (clerkDTO == null) {
...@@ -592,6 +595,7 @@ public class LoginController extends WebBaseController { ...@@ -592,6 +595,7 @@ public class LoginController extends WebBaseController {
userName = URLDecoder.decode(userName, "UTF-8"); userName = URLDecoder.decode(userName, "UTF-8");
} }
retMap.put("userName", userName) ; retMap.put("userName", userName) ;
retMap.put("userMobile", userMobile) ;
String ret = JSONObject.toJSONString(retMap); String ret = JSONObject.toJSONString(retMap);
AES aes = SecureUtil.aes(LOGIN_KEY.getBytes()); AES aes = SecureUtil.aes(LOGIN_KEY.getBytes());
String random = aes.encryptHex(ret); String random = aes.encryptHex(ret);
......
...@@ -28,6 +28,11 @@ public class WebLoginVO implements Serializable { ...@@ -28,6 +28,11 @@ public class WebLoginVO implements Serializable {
private String operationUserId; private String operationUserId;
private String operationUserName; private String operationUserName;
/**
* 运维登录人手机号
*/
private String userMobile;
public String getStaffId() { public String getStaffId() {
return staffId; return staffId;
} }
...@@ -149,4 +154,13 @@ public class WebLoginVO implements Serializable { ...@@ -149,4 +154,13 @@ public class WebLoginVO implements Serializable {
this.operationUserName = operationUserName; this.operationUserName = operationUserName;
return this; return this;
} }
public String getUserMobile() {
return userMobile;
}
public WebLoginVO setUserMobile(String userMobile) {
this.userMobile = userMobile;
return this;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment