mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 01:19:19 +08:00
重构电商模块
This commit is contained in:
+6
-2
@@ -26,8 +26,12 @@ public class CurrentUserContext {
|
||||
*/
|
||||
public TokenPayload getCurrentUserPayload() {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (authentication == null || authentication.getCredentials() == null) {
|
||||
throw new BusinessException("用户未登录");
|
||||
if (authentication == null) {
|
||||
throw new BusinessException("用户未登录 - 认证信息为空");
|
||||
}
|
||||
|
||||
if (authentication.getCredentials() == null) {
|
||||
throw new BusinessException("用户未登录 - Token信息为空");
|
||||
}
|
||||
|
||||
String token = authentication.getCredentials().toString();
|
||||
|
||||
Reference in New Issue
Block a user