银行联号
This commit is contained in:
parent
f176c14386
commit
2c4959267b
|
|
@ -53,12 +53,12 @@ public class Sm4Utils {
|
|||
|
||||
// 测试方法,演示加密和解密过程
|
||||
public static void main(String[] args) {
|
||||
String plainText = "15398187429";
|
||||
String plainText = "0637408c46ba0d91f40523e84a0e11cda20cef429d9f7f1c7f7e804498feb1aa09372fbf128d227c67396f81a0f1764f8b64e5897564ebb16f5d365904e6dcdb2a3d97b458cf6130c7f9e5ab3bbce042";
|
||||
System.out.println("原文: " + plainText);
|
||||
|
||||
// 加密明文
|
||||
String encryptedText = Sm4Utils.encrypt(plainText);
|
||||
System.out.println("加密后: " + encryptedText);
|
||||
// String encryptedText = Sm4Utils.encrypt(plainText);
|
||||
// System.out.println("加密后: " + encryptedText);
|
||||
|
||||
// 解密密文
|
||||
String decryptedText = Sm4Utils.decrypt(plainText);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.gateway.filter;
|
||||
|
||||
import com.bonus.common.core.exception.CaptchaException;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.encryption.Sm3Util;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -78,10 +79,16 @@ public class RequestCoverFilter implements GlobalFilter, Ordered {
|
|||
// 如果解密和完整性校验均未启用,则直接通过过滤链
|
||||
ServerHttpRequest request = exchange.getRequest();
|
||||
MediaType contentType = request.getHeaders().getContentType();
|
||||
String jm=request.getHeaders().getFirst("encryptrequest");
|
||||
if (contentType == null) {
|
||||
log.info("请求头中无Content-Type信息,直接继续过滤链。");
|
||||
if(StringUtils.isEmpty(jm) || "false".equals(jm)){
|
||||
return chain.filter(exchange);
|
||||
}else{
|
||||
return handleUrlParams(exchange, chain);
|
||||
}
|
||||
// return chain.filter(exchange);
|
||||
return handleUrlParams(exchange, chain);
|
||||
|
||||
} else if (contentType.isCompatibleWith(MediaType.APPLICATION_JSON)) {
|
||||
return handleBodyRequest(exchange, chain);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@
|
|||
pw.phone,
|
||||
bwwc.id,
|
||||
bwwc.bank_card_code,
|
||||
bwwc.bank_identifier_code,
|
||||
bwwc.bank_name,
|
||||
bwwc.bank_branch_name,
|
||||
bwwc.update_time
|
||||
|
|
|
|||
Loading…
Reference in New Issue