From c64a35837cd774f6cde12ec6d3c10661410c5c3b Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 26 Feb 2021 14:59:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9sso=E5=B1=85=E6=B0=91?= =?UTF-8?q?=E7=AB=AF=E7=99=BB=E5=BD=95=E6=8E=A5=E5=8F=A3=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/SsoController.java | 4 ++-- .../src/main/java/com/epmet/service/SsoService.java | 2 +- .../main/java/com/epmet/service/impl/SsoServiceImpl.java | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/controller/SsoController.java b/epmet-auth/src/main/java/com/epmet/controller/SsoController.java index 2f5f480bf0..e7ee68d696 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/SsoController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/SsoController.java @@ -37,9 +37,9 @@ public class SsoController { * @date 2021/1/18 下午4:59 */ @PostMapping("resi/login") - public Result ssoLogin(@RequestBody SsoLoginFormDTO formDTO){ + public Result ssoResiLogin(@RequestBody SsoLoginFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, SsoLoginFormDTO.SsoLoginForm.class); - return new Result().ok(ssoService.ssoLogin(formDTO)); + return new Result().ok(ssoService.ssoResiLogin(formDTO)); } @PostMapping("test") diff --git a/epmet-auth/src/main/java/com/epmet/service/SsoService.java b/epmet-auth/src/main/java/com/epmet/service/SsoService.java index b1f10e5622..bb4c712ea8 100644 --- a/epmet-auth/src/main/java/com/epmet/service/SsoService.java +++ b/epmet-auth/src/main/java/com/epmet/service/SsoService.java @@ -18,7 +18,7 @@ public interface SsoService { * @author zxc * @date 2021/1/18 下午4:59 */ - SsoLoginResultDTO ssoLogin(SsoLoginFormDTO formDTO); + SsoLoginResultDTO ssoResiLogin(SsoLoginFormDTO formDTO); /** * @param formDTO diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java index 16cb78efe4..b91e1981d6 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java @@ -73,7 +73,7 @@ public class SsoServiceImpl implements SsoService { * @date 2021/1/18 下午4:59 */ @Override - public SsoLoginResultDTO ssoLogin(SsoLoginFormDTO formDTO) { + public SsoLoginResultDTO ssoResiLogin(SsoLoginFormDTO formDTO) { String customerId = getCustomerId(formDTO.getAppId()); //String customerId = "3a4f923665a7a07701bcb311aac9a156"; String userId = ""; @@ -425,10 +425,10 @@ public class SsoServiceImpl implements SsoService { //2.客户Id换取第三方apiService,根据ticket换取华为Id Result apiServiceResult = operCrmOpenFeignClient.getApiServiceByCustomerId(new ApiServiceFormDTO(formDTO.getCustomerId())); if (!apiServiceResult.success()) { - throw new RenException("【SSO登录】调用OperCrm获取ApiService接口失败:", apiServiceResult.getInternalMsg()); + throw new RenException("【SSO enterOrg】调用OperCrm获取ApiService接口失败:", apiServiceResult.getInternalMsg()); } if (apiServiceResult.getData() == null || StringUtils.isBlank(apiServiceResult.getData().getApiServiceName())) { - throw new RenException("【SSO登录】调用OperCrm获取ApiService,查询到的结果为空:", apiServiceResult.toString()); + throw new RenException("【SSO enterOrg】调用OperCrm获取ApiService,查询到的结果为空:", apiServiceResult.toString()); } ThirdPlatUserInfo userInfo; try { @@ -439,7 +439,7 @@ public class SsoServiceImpl implements SsoService { } if (null == userInfo){ throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), - "【SSO登录】调用第三方平台查询用户信息失败,用户信息为空"); + "【SSO enterOrg】调用第三方平台查询用户信息失败,用户信息为空"); } //3、记录staff_wechat,并记录用户激活状态,激活时间 From bf2e8786dca09eb69ab4acf86b497dd3857603a0 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 26 Feb 2021 15:48:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90sso=E7=99=BB=E5=BD=95=E3=80=91?= =?UTF-8?q?=E4=BF=AE=E6=94=B9third=E6=9C=8D=E5=8A=A1=E7=9A=84=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E7=9A=84=E5=86=99=E6=B3=95=EF=BC=8C=E7=94=B1=E7=A1=AC?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E6=94=B9=E4=B8=BA=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth/pom.xml | 8 ++++++++ .../main/java/com/epmet/service/impl/SsoServiceImpl.java | 6 +++++- epmet-auth/src/main/resources/bootstrap.yml | 7 ++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 74e4e92ab9..eaa22e7557 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -207,6 +207,8 @@ http://101.206.141.219:21006 xSMONWwP UUCnxLyXiB4eBF4p + + https://epmet-cloud.elinkservice.cn @@ -260,6 +262,8 @@ http://101.206.141.219:21006 xSMONWwP UUCnxLyXiB4eBF4p + + https://epmet-cloud.elinkservice.cn @@ -308,6 +312,8 @@ http://101.206.141.219:21006 xSMONWwP UUCnxLyXiB4eBF4p + + https://epmet-cloud.elinkservice.cn @@ -356,6 +362,8 @@ https://jcytc.lzjczl.com:21009 2cy0a9lA 6hU3PQgxLcXr27SE + + https://epmet-cloud.elinkservice.cn diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java index bfee9177ba..fa58ce86fa 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java @@ -26,6 +26,7 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -66,6 +67,9 @@ public class SsoServiceImpl implements SsoService { @Autowired private CpUserDetailRedis cpUserDetailRedis; + @Value("${epmet.third.urlPrefix}") + private String epmetThirdUrlPrefix; + /** * @Description 0、入口:得到token * @Param formDTO @@ -174,7 +178,7 @@ public class SsoServiceImpl implements SsoService { */ public String getCustomerId(String appId){ JSONObject jsonObject = new JSONObject(); - String customerMsgUrl = "https://epmet-cloud.elinkservice.cn/api/third/customermp/getcustomermsg/"; + String customerMsgUrl = epmetThirdUrlPrefix + "/api/third/customermp/getcustomermsg/"; String data = HttpClientManager.getInstance().sendPostByJSON(customerMsgUrl + appId, JSON.toJSONString(jsonObject)).getData(); log.info("调用third服务,根据appId查询客户信息:httpclient->url:" + customerMsgUrl + ",结果->" + data); JSONObject toResult = JSON.parseObject(data); diff --git a/epmet-auth/src/main/resources/bootstrap.yml b/epmet-auth/src/main/resources/bootstrap.yml index 35d3f0e1f7..02f3a33105 100644 --- a/epmet-auth/src/main/resources/bootstrap.yml +++ b/epmet-auth/src/main/resources/bootstrap.yml @@ -142,4 +142,9 @@ thirdplat: jcetGend: domain: @thirdplat.jcet.g.domain@ appkey: @thirdplat.jcet.g.appkey@ - appsecret: @thirdplat.jcet.g.appsecret@ \ No newline at end of file + appsecret: @thirdplat.jcet.g.appsecret@ + +epmet: +# third服务的相关配置 + third: + urlPrefix: @epmet.third.urlprefix@ \ No newline at end of file