fix: FjTool login() 中 token.substring 添加 null 保护

token 脱敏日志在 token 可能为 null 时会抛 NPE,添加 null 检查。
This commit is contained in:
yukaidi
2026-05-29 06:58:09 +08:00
parent 0ea31d631a
commit cf7fc4f502

View File

@@ -292,7 +292,7 @@ public class FjTool extends PanBase {
MultiMap h0 = MultiMap.caseInsensitiveMultiMap(); MultiMap h0 = MultiMap.caseInsensitiveMultiMap();
h0.addAll(header0); h0.addAll(header0);
h0.set("appToken", token); h0.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");
client.postAbs(UriTemplate.of(TOKEN_VERIFY_URL)) client.postAbs(UriTemplate.of(TOKEN_VERIFY_URL))
.setTemplateParam("uuid", uuid) .setTemplateParam("uuid", uuid)
.setTemplateParam("ts", tsEncode2) .setTemplateParam("ts", tsEncode2)