|
|
@@ -62,12 +62,12 @@ public class CommService {
|
|
|
|
|
|
public void requireVip() {
|
|
|
SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
|
- if (!UserRegStatus.Student.equals(user.getRegStatus())) {
|
|
|
+ if (!UserRegStatus.Student.equals(user.getRegStatus()) || null == user.getCardId()) {
|
|
|
throw new CustomException("没有权限,请开通VIP", 405);
|
|
|
}
|
|
|
DzCards card = cardsService.selectDzCardsByCardId(user.getCardId());
|
|
|
Date nowDate = Date.from(LocalDate.now().atStartOfDay(ZoneId.systemDefault()).toInstant());
|
|
|
- if (!CardTimeStatus.Valid.getVal().equals(card.getTimeStatus()) || (null != card.getOutDate() && card.getOutDate().getTime() < nowDate.getTime())) {
|
|
|
+ if (null == card || !CardTimeStatus.Valid.getVal().equals(card.getTimeStatus()) || (null != card.getOutDate() && card.getOutDate().getTime() < nowDate.getTime())) {
|
|
|
throw new CustomException("没有权限,请开通VIP", 405);
|
|
|
}
|
|
|
}
|