Commit 6bdbe34b by guojx

运维名称进行转码

parent cf5a5158
......@@ -48,6 +48,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.*;
import java.util.stream.Collectors;
......@@ -405,7 +406,7 @@ public class EnterpriseController extends WebBaseController {
AuthcenterUserDetails loginUser = (AuthcenterUserDetails) SessionContextUtil.getUser(request) ;
String operationUserId = String.valueOf(loginUser.getId());
//运维信息参数
String operationInfo = "&operationUserId=" + operationUserId + "&userName=" + loginUser.getRealName();
String operationInfo = "&operationUserId=" + operationUserId + "&userName=" + URLEncoder.encode(loginUser.getRealName(), "UTF-8");
String random = "ywLogin:" + UuidUtil.randomUUID();
RedisUtil.setCache(random, 1, 10L);
......
......@@ -2,6 +2,7 @@ package com.gic.haoban.manage.web.controller;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -200,7 +201,7 @@ public class LoginController extends WebBaseController {
@IgnoreLogin
@RequestMapping("yw-login")
public HaobanResponse ywLogin(String wxEnterpriseId, String gicEnterpriseId, String random,
HttpServletResponse response, String operationUserId, String userName) {
HttpServletResponse response, String operationUserId, String userName) throws UnsupportedEncodingException {
// 判断是否存在random
Object o = RedisUtil.getCache(random);
if (o == null) {
......@@ -210,6 +211,9 @@ public class LoginController extends WebBaseController {
return this.fail("微信企业和gic商户参数为空");
}
String gicSuperPhone = clerkService.getSuperAdminPhoneNumber(gicEnterpriseId);
if (StringUtils.isNotBlank(userName)) {
userName = URLDecoder.decode(userName, "UTF-8");
}
logger.info("好办运维登录商户id={},超管手机={},运维信息:{}-{}", gicEnterpriseId, gicSuperPhone, operationUserId, userName);
if (StringUtils.isBlank(gicSuperPhone)) {
return this.fail("商户超管的手机号未配置");
......@@ -566,7 +570,7 @@ public class LoginController extends WebBaseController {
*/
@RequestMapping("/gic-login-check")
@IgnoreLogin
public ModelAndView gicLogin(String code, String hbEnt,String hbPage, String operationUserId, String userName) {
public ModelAndView gicLogin(String code, String hbEnt,String hbPage, String operationUserId, String userName) throws UnsupportedEncodingException {
logger.info("gic登录clerkId={},hbEnt={},operationUserId={},userName={}", code, hbEnt, operationUserId, userName);
PowerClerkDTO clerkDTO = this.userService.haobanLoginBack(code);
if (clerkDTO == null) {
......@@ -584,6 +588,9 @@ public class LoginController extends WebBaseController {
retMap.put("timestamp", System.currentTimeMillis()+"") ;
//运维登录信息
retMap.put("operationUserId", operationUserId) ;
if (StringUtils.isNotBlank(userName)) {
userName = URLDecoder.decode(userName, "UTF-8");
}
retMap.put("userName", userName) ;
String ret = JSONObject.toJSONString(retMap);
AES aes = SecureUtil.aes(LOGIN_KEY.getBytes());
......
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