Commit 6b224ce4 by 徐高华

运维登录

parent 0025a5cb
...@@ -408,19 +408,20 @@ public class EnterpriseController extends WebBaseController { ...@@ -408,19 +408,20 @@ public class EnterpriseController extends WebBaseController {
/** /**
* 登录 * 登录
*
* @param wxEnterpriseId 企业微信id * @param wxEnterpriseId 企业微信id
* @param httpServletResponse response
* @throws IOException exception
*/ */
@RequestMapping("yw-login") @RequestMapping("yw-login")
public void ywLogin(String wxEnterpriseId, HttpServletResponse httpServletResponse) throws IOException { public HaobanResponse ywLogin(String wxEnterpriseId, String gicEnterpriseId, HttpServletResponse httpServletResponse) throws IOException {
String host = GlobalVar.ctxPropertiesMap.get("haoban_service_host"); String host = GlobalVar.ctxPropertiesMap.get("haoban_service_host");
logger.info("host============================>{}", host); logger.info("好办运维login,host={},gicEnterpriseId={},wxEnterpriseId={}", host,gicEnterpriseId,wxEnterpriseId);
if(org.apache.commons.lang3.StringUtils.isAnyBlank(wxEnterpriseId,gicEnterpriseId)) {
return this.fail("wxEnterpriseId和gicEnterpriseId都不能为空") ;
}
String random = "ywLogin:" + UuidUtil.randomUUID(); String random = "ywLogin:" + UuidUtil.randomUUID();
RedisUtil.setCache(random, 1, 1000L); RedisUtil.setCache(random, 1, 10L);
String url = host + LOGIN_URL + "?wxEnterpriseId=" + wxEnterpriseId + "&random=" + random; String url = host + LOGIN_URL + "?gicEnterpriseId="+gicEnterpriseId+"&wxEnterpriseId=" + wxEnterpriseId + "&random=" + random;
httpServletResponse.sendRedirect(url); httpServletResponse.sendRedirect(url);
return this.success(null) ;
} }
......
...@@ -146,24 +146,15 @@ public class LoginController extends WebBaseController { ...@@ -146,24 +146,15 @@ public class LoginController extends WebBaseController {
*/ */
@IgnoreLogin @IgnoreLogin
@RequestMapping("yw-login") @RequestMapping("yw-login")
public HaobanResponse ywLogin(String enterpriseId, String wxEnterpriseId, String random, public HaobanResponse ywLogin(String wxEnterpriseId, String gicEnterpriseId , String random,HttpServletResponse response) {
HttpServletResponse response) {
// 判断是否存在random // 判断是否存在random
Object o = RedisUtil.getCache(random); Object o = RedisUtil.getCache(random);
if (o == null) { if (o == null) {
return resultResponse(HaoBanErrCode.ERR_4); return resultResponse(HaoBanErrCode.ERR_4);
} }
if (StringUtils.isBlank(enterpriseId)) { String gicSuperPhone = clerkService.getSuperAdminPhoneNumber(gicEnterpriseId);
List<EnterpriseDetailDTO> list = this.wxEnterpriseRelatedApiService logger.info("好办运维登录商户id={},超管手机={}", gicEnterpriseId, gicSuperPhone);
.listEnterpriseByWxEnterpriseId(wxEnterpriseId); String result = this.doLogin(wxEnterpriseId, gicEnterpriseId, gicSuperPhone, "yw", response);
if (CollectionUtils.isEmpty(list)) {
return resultResponse(HaoBanErrCode.ERR_4);
}
enterpriseId = list.get(0).getEnterpriseId();
}
String gicSuperPhone = clerkService.getSuperAdminPhoneNumber(enterpriseId);
logger.info("登录商户id={},超管手机={}", enterpriseId, gicSuperPhone);
String result = this.doLogin(wxEnterpriseId, enterpriseId, gicSuperPhone, "yw", response);
if (StringUtils.isNotBlank(result)) { if (StringUtils.isNotBlank(result)) {
return this.fail(result); return this.fail(result);
} }
......
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