mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-06-11 07:57:28 +00:00
fix: 移除 IzTool/IzToolWithAuth login() 中未使用的 h 变量(死代码)
并发安全修复引入的 h 变量创建后从未使用,后续请求仍通过
setTemplateParam("appToken", token) 传递 token。删除死代码并为
同一行的 token.substring 添加 null 保护。
This commit is contained in:
@@ -311,10 +311,7 @@ public class IzTool extends PanBase {
|
||||
JsonObject json = asJson(res2);
|
||||
if (json.getInteger("code") == 200) {
|
||||
token = json.getJsonObject("data").getString("appToken");
|
||||
MultiMap h = MultiMap.caseInsensitiveMultiMap();
|
||||
h.addAll(header);
|
||||
h.set("appToken", token);
|
||||
log.info("登录成功 token: {}...", token.substring(0, Math.min(8, token.length())));
|
||||
log.info("登录成功 token: {}...", token != null ? token.substring(0, Math.min(8, token.length())) : "null");
|
||||
promise1.complete();
|
||||
} else {
|
||||
// 检查是否为临时认证
|
||||
|
||||
@@ -280,10 +280,7 @@ public class IzToolWithAuth extends PanBase {
|
||||
JsonObject json = asJson(res2);
|
||||
if (json.getInteger("code") == 200) {
|
||||
token = json.getJsonObject("data").getString("appToken");
|
||||
MultiMap h = MultiMap.caseInsensitiveMultiMap();
|
||||
h.addAll(header);
|
||||
h.set("appToken", token);
|
||||
log.info("登录成功 token: {}...", token.substring(0, Math.min(8, token.length())));
|
||||
log.info("登录成功 token: {}...", token != null ? token.substring(0, Math.min(8, token.length())) : "null");
|
||||
promise1.complete();
|
||||
} else {
|
||||
// 检查是否为临时认证
|
||||
|
||||
Reference in New Issue
Block a user