|
|
@@ -35,7 +35,10 @@ public class CartService {
|
|
|
User user = SecurityUtils.getAuthenticatedUser();
|
|
|
Long userId = user.getId();
|
|
|
int userLevel = user.getLevel();
|
|
|
- int maxCount = 5 + (userLevel / 10) * 5;
|
|
|
+ int maxCount = 10 + (userLevel / 10) * 5;
|
|
|
+ if (userLevel == 0) {
|
|
|
+ maxCount = 5;
|
|
|
+ }
|
|
|
Long nowCount = (Long) collectionCartStatus().get("count");
|
|
|
if ((nowCount.intValue()) + 1 > maxCount) {
|
|
|
throw new BusinessException("已经超过当前用户等级购物车容量,当前" + userLevel + "级容量为" + maxCount);
|