fix: 【数据源】API 数据源支持添加时间戳参数。 #17244

This commit is contained in:
taojinlong
2025-11-18 17:05:19 +08:00
committed by taojinlong
parent 21bcff044a
commit fdd55c59b3
3 changed files with 5 additions and 5 deletions

View File

@@ -274,7 +274,7 @@ public class ApiUtils {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(timeFormat.split(" ")[1]);
httpClientConfig.addHeader(header.get("name").toString(), simpleDateFormat.format(date));
}
if (StringUtils.isNotEmpty(timeFormat) && timeFormat.split(" ")[0].equalsIgnoreCase("timestamp")) {
if (StringUtils.isNotEmpty(timeFormat) && timeFormat.split(" ")[0].equalsIgnoreCase("currentTimestamp")) {
httpClientConfig.addHeader(header.get("name").toString(), String.valueOf(System.currentTimeMillis()));
}
} else {
@@ -341,7 +341,7 @@ public class ApiUtils {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(timeFormat.split(" ")[1]);
params.add(argument.get("name") + "=" + simpleDateFormat.format(date));
}
if (StringUtils.isNotEmpty(timeFormat) && timeFormat.split(" ")[0].equalsIgnoreCase("timestamp")) {
if (StringUtils.isNotEmpty(timeFormat) && timeFormat.split(" ")[0].equalsIgnoreCase("currentTimestamp")) {
params.add(argument.get("name") + "=" + System.currentTimeMillis());
}
} else {
@@ -480,7 +480,7 @@ public class ApiUtils {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(timeFormat.split(" ")[1]);
body.put(jsonNode.get("name").toString(), simpleDateFormat.format(date));
}
if (StringUtils.isNotEmpty(timeFormat) && timeFormat.split(" ")[0].equalsIgnoreCase("timestamp")) {
if (StringUtils.isNotEmpty(timeFormat) && timeFormat.split(" ")[0].equalsIgnoreCase("currentTimestamp")) {
body.put(jsonNode.get("name").toString(), String.valueOf(System.currentTimeMillis()));
}
} else {

View File

@@ -114,7 +114,7 @@ const timeFunLists = [
},
{
label: t('data_source.timestamp'),
value: 'timestamp'
value: 'currentTimestamp'
}
]
</script>

View File

@@ -151,7 +151,7 @@ const timeFunLists = [
},
{
label: t('data_source.timestamp'),
value: 'timestamp'
value: 'currentTimestamp'
}
]
</script>