add TimiSpring.getRequestArg

This commit is contained in:
Timi
2025-11-02 10:22:52 +08:00
parent f2689ab812
commit 8a7946ce01

View File

@ -294,6 +294,26 @@ public class TimiSpring {
getRequest().removeAttribute(key);
}
/**
* 获取请求 URL 参数
*
* @param key 键
* @return 参数值
*/
public static String getRequestArg(String key) {
return getRequest().getParameter(key);
}
/**
* 获取请求 URL 参数(多值)
*
* @param key 键
* @return 参数值
*/
public static String[] getRequestArgs(String key) {
return getRequest().getParameterValues(key);
}
public static void addCookie(Cookie cookie) {
getResponse().addCookie(cookie);
}