guozhaoshun 6 rokov pred
rodič
commit
a771451aae

+ 7 - 0
rankin-user-service/src/main/java/cn/rankin/userservice/controller/QRCodeController.java

@@ -7,12 +7,14 @@ import cn.rankin.data.api.user.entity.LocationInfo;
 import cn.rankin.data.api.user.entity.QRCode;
 import cn.rankin.data.api.user.entity.QRCode;
 import cn.rankin.userservice.service.LocationInfoService;
 import cn.rankin.userservice.service.LocationInfoService;
 import cn.rankin.userservice.service.QRCodeService;
 import cn.rankin.userservice.service.QRCodeService;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import java.util.Date;
 import java.util.Date;
 import java.util.Map;
 import java.util.Map;
 
 
+@Slf4j
 @RestController
 @RestController
 @RequestMapping(value = "/qrcode")
 @RequestMapping(value = "/qrcode")
 public class QRCodeController {
 public class QRCodeController {
@@ -53,6 +55,11 @@ public class QRCodeController {
 
 
         QRCode entity = qrcodeService.findFirst(qrcode);
         QRCode entity = qrcodeService.findFirst(qrcode);
 
 
+        if(null == entity){
+            log.error("qrcode/callback  error ,qrcode is null");
+            return APIResult.ok("扫码失败,未找到二维码信息");
+        }
+
         if(status){
         if(status){
             qrcodeCallback(eid, entity.getSimple(), dataMap);
             qrcodeCallback(eid, entity.getSimple(), dataMap);
             entity.setStatus(2);
             entity.setStatus(2);