空指针getIsAc

This commit is contained in:
2025-11-13 17:00:45 +08:00
parent 18cb6f8ce8
commit d05a52f98e
2 changed files with 4 additions and 1 deletions

View File

@@ -82,7 +82,7 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
@Override
@Cacheable(key = "#id")
public ShopInfo getById(Serializable id) {
public ShopInfo getById(Serializable id) throws ApiNotPrintException {
ShopInfo shopInfo = super.getById(id);
if(shopInfo == null){
throw new ApiNotPrintException("店铺不存在");

View File

@@ -133,6 +133,9 @@ public class UserAuthorizationServiceImpl implements UserAuthorizationService {
* 初始化用户微信公众号二维码\
*/
private void initAc(UserInfo userInfo) {
if (userInfo.getIsAc() == null) {
userInfo.setIsAc(0);
}
if (userInfo.getIsAc() == 0 &&
(StrUtil.isBlank(userInfo.getWechatAcQrcode()) || userInfo.getAcQrcodeValidTime() == null || userInfo.getAcQrcodeValidTime().isBefore(LocalDateTime.now()))) {
String qrCode = acAccountUtil.createQrCode(userInfo.getId());