登录返回店铺授权过期日期
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
package cn.ysk.cashier.config.security.rest;
|
||||
|
||||
import cn.hutool.core.comparator.CompareUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -169,8 +170,8 @@ public class AuthorizationController {
|
||||
if (shopInfo != null && shopInfo.getExpireAt() != null) {
|
||||
Long expireAt = shopInfo.getExpireAt();
|
||||
Date time = DateUtil.calendar(expireAt).getTime();
|
||||
authInfo.put("expireDate", DateUtil.formatDate(time));
|
||||
if (DateUtil.compare(new Date(), time) > 0) {
|
||||
authInfo.put("expireDate", DateUtil.formatDateTime(time));
|
||||
if (CompareUtil.compare(time, new Date()) < 0) {
|
||||
throw new BadRequestException("店铺已到期,请联系区域经理续费");
|
||||
}
|
||||
}
|
||||
@@ -248,8 +249,8 @@ public class AuthorizationController {
|
||||
if (shopInfo != null && shopInfo.getExpireAt() != null) {
|
||||
Long expireAt = shopInfo.getExpireAt();
|
||||
Date time = DateUtil.calendar(expireAt).getTime();
|
||||
authInfo.put("expireDate", DateUtil.formatDate(time));
|
||||
if (DateUtil.compare(new Date(), time) > 0) {
|
||||
authInfo.put("expireDate", DateUtil.formatDateTime(time));
|
||||
if (DateUtil.compare(time, new Date()) > 0) {
|
||||
throw new BadRequestException("店铺已到期,请联系区域经理续费");
|
||||
}
|
||||
}
|
||||
@@ -298,5 +299,4 @@ public class AuthorizationController {
|
||||
onlineUserService.logout(tokenProvider.getToken(request));
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user