|
@@ -25,13 +25,13 @@ public class TaCompanySealUtil {
|
25
|
25
|
@Autowired
|
26
|
26
|
private TaMiniappMapper taMiniappMapper;
|
27
|
27
|
|
28
|
|
- public String addSignaTure(String customerId, String imgUrl, String miniappId) throws Exception {
|
29
|
|
- FddClientBase base = new FddClientBase(fadadaProperties.getAppId(), fadadaProperties.getAppSecret(), fadadaProperties.getVersion(), getFddServerHost(miniappId,fadadaProperties.getServeHost()));
|
|
28
|
+ public String addSignaTure(String customerId, String imgUrl) throws Exception {
|
|
29
|
+ FddClientBase base = new FddClientBase(fadadaProperties.getAppId(), fadadaProperties.getAppSecret(), fadadaProperties.getVersion(), fadadaProperties.getServeHost());
|
30
|
30
|
String base64Url = FddEncryptTool.ImageToBase64ByOnline(imgUrl);
|
31
|
31
|
return base.invokeaddSignature(customerId, base64Url);
|
32
|
32
|
}
|
33
|
33
|
|
34
|
|
- public String replaceSignature(String customerId, String signatureId, String imgUrl, String miniappId){
|
|
34
|
+ public String replaceSignature(String customerId, String signatureId, String imgUrl){
|
35
|
35
|
String base64Url = FddEncryptTool.ImageToBase64ByOnline(imgUrl);
|
36
|
36
|
ArrayList params = new ArrayList();
|
37
|
37
|
|
|
@@ -51,10 +51,10 @@ public class TaCompanySealUtil {
|
51
|
51
|
throw new RuntimeException(var7);
|
52
|
52
|
}
|
53
|
53
|
|
54
|
|
- return HttpsUtil.doPost(getFddServerHost(miniappId,fadadaProperties.getServeHost()) + "replace_signature.api", params);
|
|
54
|
+ return HttpsUtil.doPost(fadadaProperties.getServeHost() + "replace_signature.api", params);
|
55
|
55
|
}
|
56
|
56
|
|
57
|
|
- public String delSignature(String customerId, String signatureId, String miniappId){
|
|
57
|
+ public String delSignature(String customerId, String signatureId){
|
58
|
58
|
ArrayList params = new ArrayList();
|
59
|
59
|
|
60
|
60
|
try {
|
|
@@ -72,14 +72,14 @@ public class TaCompanySealUtil {
|
72
|
72
|
throw new RuntimeException(var7);
|
73
|
73
|
}
|
74
|
74
|
|
75
|
|
- return HttpsUtil.doPost(getFddServerHost(miniappId,fadadaProperties.getServeHost()) + "remove_signature.api", params);
|
|
75
|
+ return HttpsUtil.doPost(fadadaProperties.getServeHost() + "remove_signature.api", params);
|
76
|
76
|
}
|
77
|
77
|
|
78
|
|
- public String autoAuthCompanySeal(String transactionId, Integer authType, String contractId, String customerId, String companyId, String miniappId) throws Exception {
|
|
78
|
+ public String autoAuthCompanySeal(String transactionId, Integer authType, String contractId, String customerId, String companyId) throws Exception {
|
79
|
79
|
String timeStamp = HttpsUtil.getTimeStamp();
|
80
|
80
|
String sha1 = FddEncryptTool.sha1(fadadaProperties.getAppId() + FddEncryptTool.md5Digest(transactionId + timeStamp) + FddEncryptTool.sha1(fadadaProperties.getAppSecret() + customerId));
|
81
|
81
|
String msgDigest = new String(FddEncryptTool.Base64Encode(sha1.getBytes()));
|
82
|
|
- StringBuilder stringBuilder = new StringBuilder(getFddServerHost(miniappId,fadadaProperties.getServeHost()) + "before_authsign.api?");
|
|
82
|
+ StringBuilder stringBuilder = new StringBuilder(fadadaProperties.getServeHost() + "before_authsign.api?");
|
83
|
83
|
stringBuilder.append("app_id="+fadadaProperties.getAppId()+"&");
|
84
|
84
|
stringBuilder.append("customer_id="+customerId+"&");
|
85
|
85
|
stringBuilder.append("timestamp="+timeStamp+"&");
|
|
@@ -94,7 +94,7 @@ public class TaCompanySealUtil {
|
94
|
94
|
return stringBuilder.toString();
|
95
|
95
|
}
|
96
|
96
|
|
97
|
|
- public String getAuthStatus(String customerId, String miniappId){
|
|
97
|
+ public String getAuthStatus(String customerId){
|
98
|
98
|
ArrayList params = new ArrayList();
|
99
|
99
|
|
100
|
100
|
try {
|
|
@@ -111,19 +111,7 @@ public class TaCompanySealUtil {
|
111
|
111
|
throw new RuntimeException(var7);
|
112
|
112
|
}
|
113
|
113
|
|
114
|
|
- return HttpsUtil.doPost(getFddServerHost(miniappId,fadadaProperties.getServeHost()) + "get_auth_status.api", params);
|
|
114
|
+ return HttpsUtil.doPost(fadadaProperties.getServeHost() + "get_auth_status.api", params);
|
115
|
115
|
}
|
116
|
116
|
|
117
|
|
- /**
|
118
|
|
- * 替换法大大服务器地址
|
119
|
|
- * @return
|
120
|
|
- */
|
121
|
|
- private String getFddServerHost(String miniappId,String subUrl) {
|
122
|
|
- TaMiniapp taMiniapp = taMiniappMapper.selectById(miniappId);
|
123
|
|
- int index = subUrl.indexOf(File.separator);
|
124
|
|
- int twoIndex = subUrl.indexOf(File.separator,index);
|
125
|
|
- int threeIndex = subUrl.indexOf(File.separator,twoIndex);
|
126
|
|
- String newUrl = StringUtils.isEmpty(taMiniapp.getFddServerHost()) ? subUrl : taMiniapp.getFddServerHost() + subUrl.substring(threeIndex);
|
127
|
|
- return newUrl;
|
128
|
|
- }
|
129
|
117
|
}
|