mirror of
https://github.com/201206030/novel-plus.git
synced 2025-07-03 16:06:38 +00:00
bug修复
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package com.java2nb.novel.controller;
|
||||
|
||||
import com.java2nb.novel.core.bean.UserDetails;
|
||||
import com.java2nb.novel.core.utils.CookieUtil;
|
||||
import com.java2nb.novel.core.utils.JwtTokenUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -17,13 +18,9 @@ public class BaseController {
|
||||
|
||||
|
||||
protected String getToken(HttpServletRequest request){
|
||||
Cookie[] cookies = request.getCookies();
|
||||
if(cookies != null) {
|
||||
for (Cookie cookie : cookies) {
|
||||
if (cookie.getName().equals("Authorization")) {
|
||||
return cookie.getValue();
|
||||
}
|
||||
}
|
||||
String token = CookieUtil.getCookie(request,"Authorization");
|
||||
if(token != null){
|
||||
return token;
|
||||
}
|
||||
return request.getHeader("Authorization");
|
||||
}
|
||||
|
Reference in New Issue
Block a user