guozhaoshun пре 6 година
родитељ
комит
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.userservice.service.LocationInfoService;
 import cn.rankin.userservice.service.QRCodeService;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.Date;
 import java.util.Map;
 
+@Slf4j
 @RestController
 @RequestMapping(value = "/qrcode")
 public class QRCodeController {
@@ -53,6 +55,11 @@ public class QRCodeController {
 
         QRCode entity = qrcodeService.findFirst(qrcode);
 
+        if(null == entity){
+            log.error("qrcode/callback  error ,qrcode is null");
+            return APIResult.ok("扫码失败,未找到二维码信息");
+        }
+
         if(status){
             qrcodeCallback(eid, entity.getSimple(), dataMap);
             entity.setStatus(2);