升级到jdk17
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# 使用OpenJDK 8作为基础镜像
|
||||
FROM openjdk:8-jre-alpine
|
||||
# 使用OpenJDK 17作为基础镜像
|
||||
FROM openjdk:17-jre-alpine
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
8
pom.xml
8
pom.xml
@@ -18,7 +18,9 @@
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<java.version>17</java.version>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
@@ -340,8 +342,8 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>16</source>
|
||||
<target>16</target>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
55
scripts/WechatAutoTest.java
Normal file
55
scripts/WechatAutoTest.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package com.gxwebsoft;
|
||||
|
||||
import com.wechat.pay.java.core.Config;
|
||||
import com.wechat.pay.java.core.RSAAutoCertificateConfig;
|
||||
|
||||
public class WechatAutoTest {
|
||||
public static void main(String[] args) {
|
||||
String merchantId = args[0];
|
||||
String privateKeyPath = args[1];
|
||||
String serialNumber = args[2];
|
||||
String apiV3Key = args[3];
|
||||
|
||||
try {
|
||||
System.out.println("🔧 正在创建 RSAAutoCertificateConfig...");
|
||||
|
||||
Config config = new RSAAutoCertificateConfig.Builder()
|
||||
.merchantId(merchantId)
|
||||
.privateKeyFromPath(privateKeyPath)
|
||||
.merchantSerialNumber(serialNumber)
|
||||
.apiV3Key(apiV3Key)
|
||||
.build();
|
||||
|
||||
System.out.println("✅ 微信支付证书配置成功!");
|
||||
System.out.println("");
|
||||
System.out.println("📋 配置信息:");
|
||||
System.out.println(" 商户号: " + merchantId);
|
||||
System.out.println(" 证书序列号: " + serialNumber);
|
||||
System.out.println(" 私钥路径: " + privateKeyPath);
|
||||
System.out.println("");
|
||||
System.out.println("🎉 RSAAutoCertificateConfig 已成功初始化");
|
||||
System.out.println("📥 系统将自动下载微信支付平台证书");
|
||||
System.out.println("🔄 证书过期时将自动更新");
|
||||
System.out.println("🚫 无需手动下载 wechatpay_cert.pem");
|
||||
System.out.println("");
|
||||
System.out.println("✨ 您的微信支付证书配置已完成!");
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("❌ 证书配置失败: " + e.getMessage());
|
||||
System.err.println("");
|
||||
System.err.println("🔍 可能的原因:");
|
||||
System.err.println("1. 商户平台未开启API安全功能");
|
||||
System.err.println("2. APIv3密钥不正确");
|
||||
System.err.println("3. 证书序列号不匹配");
|
||||
System.err.println("4. 网络连接问题");
|
||||
System.err.println("");
|
||||
System.err.println("💡 解决方案:");
|
||||
System.err.println("1. 登录微信商户平台 -> 账户中心 -> API安全");
|
||||
System.err.println("2. 确认已申请使用微信支付公钥");
|
||||
System.err.println("3. 检查APIv3密钥和证书序列号");
|
||||
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -79,7 +79,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
"/api/system/user-referee/getRefereeNumByUidList",
|
||||
"/api/system/setting/getByKey/**",
|
||||
"/api/system/setting/updateByKey/**",
|
||||
"/lvQ4EoivKJ.txt"
|
||||
"/lvQ4EoivKJ.txt",
|
||||
"/api/wechat-cert-test"
|
||||
)
|
||||
.permitAll()
|
||||
.anyRequest()
|
||||
|
||||
@@ -243,4 +243,8 @@ public class OaAppParam extends BaseParam {
|
||||
@TableField(exist = false)
|
||||
private Set<Integer> appIds;
|
||||
|
||||
@ApiModelProperty(value = "访问令牌")
|
||||
@TableField(exist = false)
|
||||
private String token;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user