format code

This commit is contained in:
thinkgem
2023-02-21 10:03:34 +08:00
parent fa39e1f593
commit 66e4e47c4a
2 changed files with 6 additions and 8 deletions

View File

@@ -4,13 +4,13 @@
*/
package com.jeesite.common.web;
import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.lang.StringUtils;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jeesite.common.codec.EncodeUtils;
import com.jeesite.common.lang.StringUtils;
/**
* Cookie工具类
* @author ThinkGem
@@ -31,8 +31,7 @@ public class CookieUtils {
* 设置 Cookie
* @param name 名称
* @param value 值
* @param maxAge 生存时间(单位秒)
* @param uri 路径
* @param path 路径
*/
public static void setCookie(HttpServletResponse response, String name, String value, String path) {
setCookie(response, name, value, path, 60*60*24*30);
@@ -43,7 +42,6 @@ public class CookieUtils {
* @param name 名称
* @param value 值
* @param maxAge 生存时间(单位秒)
* @param uri 路径
*/
public static void setCookie(HttpServletResponse response, String name, String value, int maxAge) {
setCookie(response, name, value, "/", maxAge);
@@ -53,8 +51,8 @@ public class CookieUtils {
* 设置 Cookie
* @param name 名称
* @param value 值
* @param path 路径
* @param maxAge 生存时间(单位秒)
* @param uri 路径
*/
public static void setCookie(HttpServletResponse response, String name, String value, String path, int maxAge) {
if (StringUtils.isNotBlank(name)){

View File

@@ -29,7 +29,7 @@ public class InnerFilter extends AccessControlFilter {
"shiro.innerFilterAllowRemoteAddrs", "127.0.0.1"), ",");
}
if (prefixes != null && request instanceof HttpServletRequest){
String ip = ((HttpServletRequest)request).getRemoteAddr();
String ip = request.getRemoteAddr();
for (String prefix : prefixes){
result = StringUtils.startsWithIgnoreCase(ip, StringUtils.trim(prefix));
if (result){