重构电商模块

This commit is contained in:
ah--desktop
2025-09-19 23:54:16 +08:00
parent e0e31510d1
commit 543b6a0ad3
25 changed files with 295 additions and 715 deletions
@@ -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();