瀏覽代碼

fix:日志填充

hidewnd 2 周之前
父節點
當前提交
979c5abbd4

+ 2 - 1
yt-common/src/main/java/com/ytpm/handle/AbstractLoginService.java

@@ -179,10 +179,11 @@ public abstract class AbstractLoginService {
     protected void loginRiskCheck(YtUser ytUser, Map<String, Object> paramMap) {
         Result<?> result = remoteCheckLoginRisk(ytUser);
         if (result == null) {
-            throw new CommonException("feign invoke Fail!");
+            throw new CommonException("[login risk]feign invoke Fail!");
         }
         if (result.getCode() != 200) {
             String errorMessage = result.getMessage();
+            log.info("[login risk]code:{},message:{}, data:{}", result.getCode(), errorMessage, result.getData());
             if (ytUser.getLoginType() == LoginType.VISITOR && RepMessage.RISK_VISITOR_LOWER_VALUE.equals(errorMessage)) {
                 WxDefaultConfig defaultConfig = (WxDefaultConfig) paramMap.get("defaultConfig");
                 throw new CommonException(StrUtil.emptyToDefault(defaultConfig.getLowValueTip(), errorMessage));

+ 6 - 4
yt-question/yt-question-service/src/main/java/com/ytpm/question/service/impl/AdServiceImpl.java

@@ -95,13 +95,15 @@ public class AdServiceImpl implements AdService {
             user.setPowerLimitTip(format);
             Result<?> result = riskFeign.checkAdRisk(user);
             if (result.getCode() != 200) {
+                String errorMessage = result.getMessage();
+                log.info("[login risk]code:{},message:{}, data:{}", result.getCode(), errorMessage, result.getData());
                 Result<String> resultObj = new Result<>(StatusCode.ACCESS_ERR, getTipsMsg());
                 // 766处理
-                if ("766".contains(result.getMessage())) {
-                    resultObj.setData(result.getMessage());
-                } else if (result.getCode() == StatusCode.ACCESS_RISK_ERROR && StrUtil.isNotBlank(result.getMessage())) {
+                if ("766".contains(errorMessage)) {
+                    resultObj.setData(errorMessage);
+                } else if (result.getCode() == StatusCode.ACCESS_RISK_ERROR && StrUtil.isNotBlank(errorMessage)) {
                     // 体力不再获取处理
-                    resultObj.setMessage(result.getMessage());
+                    resultObj.setMessage(errorMessage);
                     resultObj.setData("767");
                 }
                 return resultObj;

+ 3 - 3
yt-question/yt-question-service/src/main/java/com/ytpm/question/service/impl/VisitorLoginServiceImpl.java

@@ -125,12 +125,12 @@ public class VisitorLoginServiceImpl extends AbstractLoginService {
         // 唯一性判断
         YtDyzUser ytDyzUser = appUserMapper.getByDeviceAndDitch(loginParam.getDeviceId(), loginParam.getDitchId());
         if (ytDyzUser == null) {
-            log.warn(StrUtil.format("visitor register[ deviceId:{}, ditchId: {}]",
+            log.warn(StrUtil.format("[visitor register]deviceId:{}, ditchId: {}",
                     loginParam.getDeviceId(), loginParam.getDitchId()));
             beforeRegistryUser(loginParam, paramMap);
             ytDyzUser = registryUser(loginParam, paramMap);
         } else {
-            log.warn(StrUtil.format("visitor login[ deviceId:{}, ditchId: {}]",
+            log.warn(StrUtil.format("[visitor login]deviceId:{}, ditchId: {}",
                     loginParam.getDeviceId(), loginParam.getDitchId()));
             //当前渠道已有用户,校验用户是否处于风控中 & 更新用户信息
             beforeDeadWithUserCrud(loginParam, ytDyzUser, paramMap);
@@ -229,7 +229,7 @@ public class VisitorLoginServiceImpl extends AbstractLoginService {
                 adRecordIds.add(recordId);
                 totalRevenue = adRecordParam.getRevenue() == null ? totalRevenue : totalRevenue.add(adRecordParam.getRevenue());
             }
-            log.info(StrUtil.format("[visitor adRecords] userId:{} recordCount:{} revenue:{} ",
+            log.info(StrUtil.format("[visitor adRecords]userId:{} recordCount:{} revenue:{}",
                     ytDyzUser.getUserId(), adRecordIds.size(), totalRevenue));
         }
         if (CollUtil.isEmpty(adRecordIds)) {