jeecgboot/JeecgBoot · error · JeecgBootException
timastamp时间戳为空
Error message
timastamp时间戳为空
What it means
Thrown by checkSignValid when the timestamp parameter is blank. Note the message contains a typo ('timastamp') which is preserved as-is in the source. timestamp is required because it is part of the signed payload and used for the 5-minute expiry window.
Source
Thrown at jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/openapi/filter/ApiAuthFilter.java:202
}
//update-end---author:scott ---date:20260416 for:【PR/9083】OpenAPI白名单增强,支持CIDR网段和通配符匹配-----------
/**
* 签名验证
* @param appkey
* @param signature
* @param timestamp
* @return
*/
protected void checkSignValid(String appkey, String signature, String timestamp) {
if (!StringUtils.hasText(appkey)) {
throw new JeecgBootException("appkey为空");
}
if (!StringUtils.hasText(signature)) {
throw new JeecgBootException("signature为空");
}
if (!StringUtils.hasText(timestamp)) {
throw new JeecgBootException("timastamp时间戳为空");
}
if (!timestamp.matches("[0-9]*")) {
throw new JeecgBootException("timastamp时间戳不合法");
}
if (System.currentTimeMillis() - Long.parseLong(timestamp) > 5 * 60 * 1000) {
throw new JeecgBootException("signature签名已过期(超过五分钟)");
}
}
/**
* 认证信息核验
* @param appKey
* @param signature
* @param timestamp
* @param openApiAuth
* @return
* @throws Exception
*/View on GitHub (pinned to 96fb33f5ec)
Solutions
- Send timestamp as a millisecond-precision epoch string in the param/header the filter reads.
- Verify the exact parameter name against the filter's doFilterInternal extraction.
- Ensure all three credentials (appkey, signature, timestamp) are sent together.
Example fix
// before: request without timestamp
// after: String ts = String.valueOf(System.currentTimeMillis());
// request.addHeader("timestamp", ts); Defensive patterns
Strategy: validation
Validate before calling
if (timestamp == null || timestamp.trim().isEmpty()) {
throw new IllegalStateException("timestamp required");
} Prevention
- Generate timestamp in the same builder that sets appkey/signature.
- Use the exact parameter name the filter expects.
- Add a client integration test that asserts the three credentials are sent.
When it happens
Trigger: OpenAPI call with no timestamp param; client sends timestamp only in a differently-named field; clock/payload serialization drops the field.
Common situations: Client SDK omission; parameter name mismatch; test harness that omits timestamp.
Related errors
AI-assisted analysis of jeecgboot/JeecgBoot@96fb33f5ec (2026-08-14).
Data as JSON: /api/errors/7c43811cf937049f.
Report an issue: GitHub.