mirror of
https://gitee.com/novel_dev_team/novel
synced 2026-07-20 17:52:45 +08:00
fix: token 判空
This commit is contained in:
@@ -6,6 +6,7 @@ import io.github.xxyopen.novel.core.constant.SystemConfigConsts;
|
|||||||
import io.github.xxyopen.novel.core.util.JwtUtils;
|
import io.github.xxyopen.novel.core.util.JwtUtils;
|
||||||
import io.github.xxyopen.novel.dto.UserInfoDto;
|
import io.github.xxyopen.novel.dto.UserInfoDto;
|
||||||
import io.github.xxyopen.novel.manager.UserInfoCacheManager;
|
import io.github.xxyopen.novel.manager.UserInfoCacheManager;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@@ -35,7 +36,7 @@ public interface AuthStrategy {
|
|||||||
* @return 用户ID
|
* @return 用户ID
|
||||||
*/
|
*/
|
||||||
default Long authSSO(JwtUtils jwtUtils, UserInfoCacheManager userInfoCacheManager, String token) {
|
default Long authSSO(JwtUtils jwtUtils, UserInfoCacheManager userInfoCacheManager, String token) {
|
||||||
if (Objects.isNull(token)) {
|
if (!StringUtils.hasText(token)) {
|
||||||
// token 为空
|
// token 为空
|
||||||
throw new BusinessException(ErrorCodeEnum.USER_LOGIN_EXPIRED);
|
throw new BusinessException(ErrorCodeEnum.USER_LOGIN_EXPIRED);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user