银行联号

This commit is contained in:
方亮 2025-09-16 15:49:27 +08:00
parent f176c14386
commit 2c4959267b
3 changed files with 12 additions and 4 deletions

View File

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

View File

@ -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 {

View File

@ -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