Browse Source

【sso登录】修改third服务的地址的写法,由硬编码改为配置文件取

dev_shibei_match
wxz 5 years ago
parent
commit
bf2e8786dc
  1. 8
      epmet-auth/pom.xml
  2. 6
      epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java
  3. 7
      epmet-auth/src/main/resources/bootstrap.yml

8
epmet-auth/pom.xml

@ -207,6 +207,8 @@
<thirdplat.jcet.g.domain>http://101.206.141.219:21006</thirdplat.jcet.g.domain>
<thirdplat.jcet.g.appkey>xSMONWwP</thirdplat.jcet.g.appkey>
<thirdplat.jcet.g.appsecret>UUCnxLyXiB4eBF4p</thirdplat.jcet.g.appsecret>
<epmet.third.urlprefix>https://epmet-cloud.elinkservice.cn</epmet.third.urlprefix>
</properties>
</profile>
<profile>
@ -260,6 +262,8 @@
<thirdplat.jcet.g.domain>http://101.206.141.219:21006</thirdplat.jcet.g.domain>
<thirdplat.jcet.g.appkey>xSMONWwP</thirdplat.jcet.g.appkey>
<thirdplat.jcet.g.appsecret>UUCnxLyXiB4eBF4p</thirdplat.jcet.g.appsecret>
<epmet.third.urlprefix>https://epmet-cloud.elinkservice.cn</epmet.third.urlprefix>
</properties>
</profile>
<profile>
@ -308,6 +312,8 @@
<thirdplat.jcet.g.domain>http://101.206.141.219:21006</thirdplat.jcet.g.domain>
<thirdplat.jcet.g.appkey>xSMONWwP</thirdplat.jcet.g.appkey>
<thirdplat.jcet.g.appsecret>UUCnxLyXiB4eBF4p</thirdplat.jcet.g.appsecret>
<epmet.third.urlprefix>https://epmet-cloud.elinkservice.cn</epmet.third.urlprefix>
</properties>
</profile>
@ -356,6 +362,8 @@
<thirdplat.jcet.c.domain>https://jcytc.lzjczl.com:21009</thirdplat.jcet.c.domain>
<thirdplat.jcet.c.appkey>2cy0a9lA</thirdplat.jcet.c.appkey>
<thirdplat.jcet.c.appsecret>6hU3PQgxLcXr27SE</thirdplat.jcet.c.appsecret>
<epmet.third.urlprefix>https://epmet-cloud.elinkservice.cn</epmet.third.urlprefix>
</properties>
</profile>
</profiles>

6
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);

7
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@
appsecret: @thirdplat.jcet.g.appsecret@
epmet:
# third服务的相关配置
third:
urlPrefix: @epmet.third.urlprefix@
Loading…
Cancel
Save