diff --git a/minio-plus-api-wrapper/minio-plus-api-wrapper-official/pom.xml b/minio-plus-api-wrapper/minio-plus-api-wrapper-official/pom.xml
index 844151bcd..c45b191ea 100644
--- a/minio-plus-api-wrapper/minio-plus-api-wrapper-official/pom.xml
+++ b/minio-plus-api-wrapper/minio-plus-api-wrapper-official/pom.xml
@@ -28,6 +28,10 @@
okhttp
4.11.0
+
+ cn.hutool
+ hutool-all
+
\ No newline at end of file
diff --git a/minio-plus-api-wrapper/minio-plus-api-wrapper-official/src/test/java/MinIORestful.java b/minio-plus-api-wrapper/minio-plus-api-wrapper-official/src/test/java/MinIORestful.java
index 42ec73ec7..d671a8343 100644
--- a/minio-plus-api-wrapper/minio-plus-api-wrapper-official/src/test/java/MinIORestful.java
+++ b/minio-plus-api-wrapper/minio-plus-api-wrapper-official/src/test/java/MinIORestful.java
@@ -9,6 +9,7 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Multimap;
import com.google.common.collect.MultimapBuilder;
import com.google.common.io.BaseEncoding;
+import io.minio.Digest;
import javax.crypto.Mac;
@@ -37,7 +38,11 @@ public class MinIORestful {
// 动态传入参数
String url = "http://localhost:9000/document";
- HttpResponse httpResponse = request(url,"","/document","head");
+// ZonedDateTime date = ZonedDateTime.parse("2024-05-31T16:31:54Z");
+ // 取得当前时间
+ ZonedDateTime date = ZonedDateTime.now();
+
+ HttpResponse httpResponse = request(url,"","/document","HEAD",date);
System.out.println("httpResponse.isOk()="+httpResponse.isOk());
System.out.println("httpResponse.getStatus()="+httpResponse.getStatus());
@@ -46,10 +51,9 @@ public class MinIORestful {
}
- public static HttpResponse request(String url,String params,String path,String method) throws NoSuchAlgorithmException, InvalidKeyException {
+ public static HttpResponse request(String url,String params,String path,String method,ZonedDateTime date) throws NoSuchAlgorithmException, InvalidKeyException {
+
- // 取得当前时间
- ZonedDateTime date = ZonedDateTime.now();
// 创建除Authorization外所有header
Map> headers = new HashMap<>();
@@ -173,7 +177,8 @@ public class MinIORestful {
,String canonicalQueryString,String method,String path) throws NoSuchAlgorithmException {
String canonicalRequest = method + "\n" + path + "\n" + canonicalQueryString + "\n"
- + Joiner.on("\n").withKeyValueSeparator(":").join(canonicalHeaders) + "\n\n" + signedHeaders + "\n" + "x-amz-content-sha256";
+ + Joiner.on("\n").withKeyValueSeparator(":").join(canonicalHeaders) + "\n\n" + signedHeaders + "\n" + ZERO_SHA256_HASH;
+ System.out.println("canonicalRequest="+canonicalRequest);
return Digest.sha256Hash(canonicalRequest);
}
diff --git a/minio-plus-application/minio-plus-application-mysql/src/main/resources/application.yml b/minio-plus-application/minio-plus-application-mysql/src/main/resources/application.yml
index 776c8fbf9..efc249a4d 100644
--- a/minio-plus-application/minio-plus-application-mysql/src/main/resources/application.yml
+++ b/minio-plus-application/minio-plus-application-mysql/src/main/resources/application.yml
@@ -25,11 +25,11 @@ spring:
#驱动名称
driver-class-name: com.mysql.cj.jdbc.Driver
#链接地址
- url: jdbc:mysql://localhost:3306/minio_plus?characterEncoding=UTF-8&useSSL=true&serverTimezone=Asia/Shanghai
+ url: jdbc:mysql://192.168.50.141:3306/minio-plus?characterEncoding=UTF-8&useSSL=true&serverTimezone=Asia/Shanghai
#用户名
- username: root
+ username: minio
#密码
- password: root
+ password: minioadmin
##################################################################
# 服务器
##################################################################