Selaa lähdekoodia

提价证书登录代码

liangjianf 2 vuotta sitten
vanhempi
commit
41baa5010f

+ 11 - 3
zlt-business/idaas-center/src/main/java/com/central/modules/webservice/controller/WebserviceController.java

@@ -1,6 +1,7 @@
 package com.central.modules.webservice.controller;
 
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.central.common.Constant;
 import com.central.common.Result;
@@ -123,9 +124,16 @@ public class WebserviceController {
         String identityTicket = param.get("identityTicket");
         String appServerID = param.get("appServerID");
         String XMLStr = WSService.verifyIdentityTicket(challenge, identityTicket, appServerID);
-        log.info("证书登录成功");
-        String jsonStr = XMLUtil.xml2Json(JSONObject.parseObject(XMLStr).getString("result")) ;
-        String userName = JSONObject.parseObject(jsonStr).getJSONObject("userinfo").getString("name");
+        String jsonStr = XMLUtil.xml2Json(JSONObject.parseObject(XMLStr).getString("result"));
+        log.info("证书网关接口返回内容为:" + jsonStr+",发送参数为"+JSON.toJSONString(param));
+        JSONObject responseObj = JSONObject.parseObject(jsonStr);
+        if("-1".equals(responseObj.getString("result"))){
+            return Result.error("证书网关登录失败,"+responseObj.getString("error"));
+        }
+        String userName = responseObj.getJSONObject("userinfo").getString("name");
+        if(StringUtils.isEmpty(userName)){
+            return Result.error("应用系统userName获取失败,请稍候重试");
+        }
         String appToken = appService.getAppToken(request, requestUuid, "/idaas/sso/smslogin");
         if(appToken == null){
             log.info("APPToken 为空!");

+ 9 - 0
zlt-business/idaas-center/src/main/java/com/central/modules/webservice/service/Impl/WSServiceImpl.java

@@ -16,6 +16,15 @@ public class WSServiceImpl implements WSService {
     @Value("${verify.url}")
     private String webUrl;
 
+    public static void main(String[] args) {
+        try {
+            String rdNum = new VerifyServiceSoapProxy("http://10.110.21.124:8000").generatorChallenge();
+            System.out.println(rdNum);
+        } catch (Exception e) {
+            System.out.println("rdNum");
+        }
+    }
+
     @Override
     public String generatorChallenge() {
         try {

+ 1 - 1
zlt-business/idaas-center/src/main/resources/application-dev.yml

@@ -146,7 +146,7 @@ idaas:
 ########################
 ###### 证书网关接口地址配置 ######
 verify:
-  url: http://127.0.0.1:8000
+  url: http://10.110.21.124:8000
 
 ########################
 ###### 系统参数配置 ######

+ 4 - 1
zlt-business/idaas-center/src/main/resources/application-prod.yml

@@ -126,7 +126,10 @@ sys:
   url:
     index: 0
   isProd: true
-
+########################
+###### 证书网关接口地址配置 ######
+verify:
+  url: http://10.110.21.124:8000
 ###################################
 ###### 北信源-豆豆社管app 配置 ######
 doudou:

+ 1 - 1
zlt-business/idaas-center/src/main/resources/bootstrap.yml

@@ -1,5 +1,5 @@
 server:
-  port: 6000
+  port: 6006
 
 zlt:
   nacos: