Skip to content

Commit 7981532

Browse files
committed
Revert "更新aList的url为/d/{path}(?sign={sign})"
This reverts commit 9322e73.
1 parent 7bfa834 commit 7981532

2 files changed

Lines changed: 3 additions & 14 deletions

File tree

CHANGELOG.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# 15.2.0
66

7-
- 更新aList的url为/d/{path}(?sign={sign})
7+
88

99
# v0.12.11
1010

src/main/java/run/ikaros/plugin/alist/AListClient.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
import run.ikaros.api.store.enums.AttachmentType;
3030
import run.ikaros.plugin.alist.AListConst.ConfigMapKey;
3131

32-
import java.net.URLEncoder;
33-
import java.nio.charset.StandardCharsets;
3432
import java.time.Duration;
3533
import java.time.LocalDateTime;
3634
import java.util.*;
@@ -92,12 +90,7 @@ private Mono<Void> createAttachmentRecursively(List<String> paths, Long parentId
9290
})
9391
.flatMap(aListAttachment -> {
9492
String path = getPathByPathArr(aListAttachment.getPaths());
95-
AListAttachment att = fetchAttachmentDetail(path, aListAttachment);
96-
String name = path.substring(path.lastIndexOf('/') + 1);
97-
att.setRaw_url(token.getUrl()
98-
+ "/d" + path.replace(name, URLEncoder.encode(name, StandardCharsets.UTF_8).replace("+", "%20"))
99-
+ (StringUtils.isNotBlank(att.getSign()) ? "?sign=" + att.getSign() : ""));
100-
return Mono.just(att);
93+
return Mono.just(fetchAttachmentDetail(path, aListAttachment));
10194
})
10295
.flatMap(this::saveAListAttachment)
10396
.flatMap(aListAttachment -> {
@@ -316,11 +309,7 @@ public AListToken cm2token(ConfigMap cm) {
316309
if (cmd == null) {
317310
cmd = new HashMap<>();
318311
}
319-
String url = cmd.get(ConfigMapKey.apiBaseUrl);
320-
if (url.endsWith("/")) {
321-
url = url.substring(0, url.length() - 1);
322-
}
323-
token.setUrl(url);
312+
token.setUrl(cmd.get(ConfigMapKey.apiBaseUrl));
324313
token.setUsername(cmd.get(ConfigMapKey.apiUsername));
325314
token.setPassword(cmd.get(ConfigMapKey.apiPassword));
326315
token.setEnableAutoTokenRefresh(

0 commit comments

Comments
 (0)