| | |
| | | |
| | | import com.se.common.core.constant.Constants; |
| | | import com.se.common.core.text.StrFormatter; |
| | | import org.springframework.http.HttpCookie; |
| | | import org.springframework.http.server.reactive.ServerHttpRequest; |
| | | import org.springframework.util.AntPathMatcher; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.MultiValueMap; |
| | | |
| | | import javax.servlet.http.Cookie; |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static String getValueFromCookie(ServerHttpRequest request, String key) { |
| | | MultiValueMap<String, HttpCookie> cookies = request.getCookies(); |
| | | if (CollectionUtils.isEmpty(cookies)) { |
| | | return null; |
| | | } |
| | | |
| | | for (Map.Entry<String, List<HttpCookie>> itemList : cookies.entrySet()) { |
| | | for (HttpCookie cookie :itemList.getValue()) { |
| | | if (cookie.getName().equals(key)){ |
| | | return cookie.getValue(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public static String getValueFromCookie(HttpServletRequest request,String key) { |
| | | Cookie[] cookies = request.getCookies(); |
| | | if (cookies == null || cookies.length == 0) { |