Commit 7a0da98f authored by 李健华's avatar 李健华

Merge branch 'hotfix/datasource-max-pool-size-20220913' into 'master'

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

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