fix: 移除 IzTool/IzToolWithAuth login() 中未使用的 h 变量(死代码)

并发安全修复引入的 h 变量创建后从未使用,后续请求仍通过
setTemplateParam("appToken", token) 传递 token。删除死代码并为
同一行的 token.substring 添加 null 保护。
This commit is contained in:
yukaidi
2026-05-29 06:57:44 +08:00
parent 74840ab63f
commit 0ea31d631a
2 changed files with 2 additions and 8 deletions

View File

@@ -311,10 +311,7 @@ public class IzTool extends PanBase {
JsonObject json = asJson(res2); JsonObject json = asJson(res2);
if (json.getInteger("code") == 200) { if (json.getInteger("code") == 200) {
token = json.getJsonObject("data").getString("appToken"); token = json.getJsonObject("data").getString("appToken");
MultiMap h = MultiMap.caseInsensitiveMultiMap(); log.info("登录成功 token: {}...", token != null ? token.substring(0, Math.min(8, token.length())) : "null");
h.addAll(header);
h.set("appToken", token);
log.info("登录成功 token: {}...", token.substring(0, Math.min(8, token.length())));
promise1.complete(); promise1.complete();
} else { } else {
// 检查是否为临时认证 // 检查是否为临时认证

View File

@@ -280,10 +280,7 @@ public class IzToolWithAuth extends PanBase {
JsonObject json = asJson(res2); JsonObject json = asJson(res2);
if (json.getInteger("code") == 200) { if (json.getInteger("code") == 200) {
token = json.getJsonObject("data").getString("appToken"); token = json.getJsonObject("data").getString("appToken");
MultiMap h = MultiMap.caseInsensitiveMultiMap(); log.info("登录成功 token: {}...", token != null ? token.substring(0, Math.min(8, token.length())) : "null");
h.addAll(header);
h.set("appToken", token);
log.info("登录成功 token: {}...", token.substring(0, Math.min(8, token.length())));
promise1.complete(); promise1.complete();
} else { } else {
// 检查是否为临时认证 // 检查是否为临时认证