Commit 739b465c authored by 李健华's avatar 李健华

神策埋点增加开关配置,默认关闭

parent 59578b77
......@@ -27,6 +27,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.Authentication;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -61,6 +62,9 @@ public class AppController implements IBaseController {
@Autowired
private IUserRegisterService userRegisterService;
@Value("${sc.is.open:false}")
private Boolean scIsOpen;
@IpValidator
@AuthorizationPoint
@RequestMapping("/auth/v1/login")
......@@ -263,6 +267,8 @@ public class AppController implements IBaseController {
log.info("=setLoginInfo end");
log.info("第三方用户获取信息登录成功 [AppController] loginSuper --> loginFrom:{}, phoneNo:{},appChannel:{},channelId:{}", registerFrom, phoneNo, appChannel, channelId);
// 登陆是否上报神策
if (scIsOpen) {
try {
String scDeviceId=request.getHeader("scDeviceId");
if(!StringUtils.isEmpty(scDeviceId)){
......@@ -297,6 +303,7 @@ public class AppController implements IBaseController {
} catch (Exception e) {
log.info("神策埋点出现问题", e);
}
}
return JsonResult.buildSuccessResult("登陆成功", loginInfo);
}
......
......@@ -31,6 +31,7 @@ import com.sensorsdata.analytics.javasdk.bean.EventRecord;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Caching;
import org.springframework.context.ApplicationEventPublisher;
......@@ -116,6 +117,9 @@ public class UserServiceImpl implements IUserService, IBaseController {
@Resource
private IGeetestLogService geetestLogService;
@Value("${sc.is.open:false}")
private Boolean scIsOpen;
@Override
// @Cacheable(value = "usercache", key = "'xyqbuser' + #phone", unless = "#result == null", cacheManager = "cacheManager")
public User findByPhoneInDb(String phone) {
......@@ -391,6 +395,8 @@ public class UserServiceImpl implements IUserService, IBaseController {
if (!wechatRelateUserIfNecessary(user, request)) {
return JsonResult.buildErrorStateResult("登录时微信关联失败", null);
}
if (scIsOpen) {
try {
String scDeviceId = request.getHeader("scDeviceId");
if (!StringUtils.isEmpty(scDeviceId)) {
......@@ -426,6 +432,7 @@ public class UserServiceImpl implements IUserService, IBaseController {
} catch (Exception e) {
log.info("神策埋点出现问题", e);
}
}
oauthLoginInfoService.addLoginInfo(user, tenantId);
// 更新极验用户userID
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment