add 118, 微雨云

This commit is contained in:
QAIU
2024-10-26 16:04:49 +08:00
parent 498bce5255
commit dacf93bd06
10 changed files with 214 additions and 8 deletions
@@ -32,7 +32,8 @@ public abstract class PanBase implements IPanTool {
/**
* Http client
*/
protected WebClient client = WebClient.create(WebClientVertxInit.get());
protected WebClient client = WebClient.create(WebClientVertxInit.get(),
new WebClientOptions().setUserAgentEnabled(false));
/**
* Http client session (会话管理, 带cookie请求)
@@ -103,6 +104,10 @@ public abstract class PanBase implements IPanTool {
}
}
protected void fail() {
fail("");
}
/**
* 生成失败Future的处理器
*
@@ -113,6 +118,10 @@ public abstract class PanBase implements IPanTool {
return t -> fail(shareLinkInfo.getPanName() + "-" + shareLinkInfo.getType() + " - 请求异常 {}: -> {}", errorMsg, t.fillInStackTrace());
}
protected Handler<Throwable> handleFail() {
return handleFail("");
}
/**
* bodyAsJsonObject的封装, 会自动处理异常