Compare commits
No commits in common. "fef898f1188b8708c2ad1699b6c75976e9798862" and "07c01e3ecd6696fa424bf4cc29bb3a52f60d66b5" have entirely different histories.
fef898f118
...
07c01e3ecd
@ -9,7 +9,9 @@ import io.gisbi.auth.config.SubstituleLoginConfig;
|
||||
import io.gisbi.auth.vo.TokenVO;
|
||||
import io.gisbi.exception.DEException;
|
||||
import io.gisbi.i18n.Translator;
|
||||
import io.gisbi.utils.*;
|
||||
import io.gisbi.utils.LogUtil;
|
||||
import io.gisbi.utils.Md5Utils;
|
||||
import io.gisbi.utils.RsaUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -45,21 +47,6 @@ public class SubstituleLoginServer {
|
||||
return generate(tokenUserBO, md5Pwd);
|
||||
}
|
||||
|
||||
@GetMapping("/login/refresh")
|
||||
public TokenVO refresh() {
|
||||
// 从请求头中获取现有的 token
|
||||
String oldToken = ServletUtils.getToken();
|
||||
|
||||
if (StringUtils.isBlank(oldToken)) {
|
||||
DEException.throwException("token为空!");
|
||||
}
|
||||
// 解析旧 token 获取用户信息
|
||||
TokenUserBO userBO = TokenUtils.validate(oldToken);
|
||||
|
||||
// 生成新的 token
|
||||
String secret = SubstituleLoginConfig.getPwd(); // 获取密钥
|
||||
return generate(userBO, secret);
|
||||
}
|
||||
|
||||
@GetMapping("/logout")
|
||||
public void logout() {
|
||||
|
@ -80,9 +80,9 @@ public class TokenFilter implements Filter {
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
return;
|
||||
}
|
||||
String token = ServletUtils.getToken();
|
||||
TokenUserBO userBO = TokenUtils.validate(token);
|
||||
UserUtils.setUserInfo(userBO);
|
||||
// String token = ServletUtils.getToken();
|
||||
// TokenUserBO userBO = TokenUtils.validate(token);
|
||||
// UserUtils.setUserInfo(userBO);
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
|
Loading…
Reference in New Issue
Block a user