Commit abe54262 authored by xiaozhe.chen's avatar xiaozhe.chen

添加修改手机号后台管理接口

parent 196572b0
...@@ -14,14 +14,13 @@ import java.io.IOException; ...@@ -14,14 +14,13 @@ import java.io.IOException;
public class CsrfHeaderFilter extends OncePerRequestFilter { public class CsrfHeaderFilter extends OncePerRequestFilter {
@Override @Override
protected void doFilterInternal(HttpServletRequest request, protected void doFilterInternal(HttpServletRequest request,
HttpServletResponse response, FilterChain filterChain) HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
throws ServletException, IOException { CsrfToken csrf = (CsrfToken) request.getAttribute(CsrfToken.class.getName());
CsrfToken csrf = (CsrfToken) request.getAttribute(CsrfToken.class
.getName());
if (csrf != null) { if (csrf != null) {
Cookie cookie = WebUtils.getCookie(request, "XSRF-TOKEN"); Cookie cookie = WebUtils.getCookie(request, "XSRF-TOKEN");
String token = csrf.getToken(); String token = csrf.getToken();
if (cookie == null || token != null && !token.equals(cookie.getValue())) { boolean existed = cookie == null || token != null && !token.equals(cookie.getValue());
if (existed) {
cookie = new Cookie("XSRF-TOKEN", token); cookie = new Cookie("XSRF-TOKEN", token);
cookie.setPath("/"); cookie.setPath("/");
response.addCookie(cookie); response.addCookie(cookie);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment