Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
head_group
xyqb-user2
Commits
739b465c
Commit
739b465c
authored
Sep 13, 2022
by
李健华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
神策埋点增加开关配置,默认关闭
parent
59578b77
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
55 deletions
+69
-55
AppController.java
...antgroup/xyqb/controller/internal/user/AppController.java
+34
-27
UserServiceImpl.java
...cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
+35
-28
No files found.
src/main/java/cn/quantgroup/xyqb/controller/internal/user/AppController.java
View file @
739b465c
...
...
@@ -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
);
}
...
...
src/main/java/cn/quantgroup/xyqb/service/user/impl/UserServiceImpl.java
View file @
739b465c
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment