mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-06-11 07:57:28 +00:00
fix: 修复 ParserApi 中 redirectUrl() 和 viewUrl() 的 Promise 未 complete 问题
This commit is contained in:
@@ -157,7 +157,10 @@ public class ParserApi {
|
||||
Promise<Void> promise = Promise.promise();
|
||||
|
||||
getFileDownUrl(type, param)
|
||||
.onSuccess(res -> ResponseUtil.redirect(response, res))
|
||||
.onSuccess(res -> {
|
||||
ResponseUtil.redirect(response, res);
|
||||
promise.complete();
|
||||
})
|
||||
.onFailure(t -> promise.fail(t.fillInStackTrace()));
|
||||
return promise.future();
|
||||
}
|
||||
@@ -237,6 +240,7 @@ public class ParserApi {
|
||||
.onSuccess(res -> {
|
||||
String url = viewPrefix + URLEncoder.encode(res, StandardCharsets.UTF_8);
|
||||
ResponseUtil.redirect(response, url);
|
||||
promise.complete();
|
||||
})
|
||||
.onFailure(t -> promise.fail(t.fillInStackTrace()));
|
||||
return promise.future();
|
||||
|
||||
Reference in New Issue
Block a user