|
@@ -68,6 +68,9 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
public CustomerInfoForm getCurrentMember() {
|
|
|
SecurityContext ctx = SecurityContextHolder.getContext();
|
|
|
Authentication auth = ctx.getAuthentication();
|
|
|
+ if(org.springframework.util.StringUtils.isEmpty(auth)){
|
|
|
+ throw new RuntimeException("获取登陆用户失败!");
|
|
|
+ }
|
|
|
CustomerDetails memberDetails = (CustomerDetails) auth.getPrincipal();
|
|
|
return memberDetails.getCustomerInfo();
|
|
|
}
|