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
d726ca92
Commit
d726ca92
authored
Nov 15, 2021
by
gaoguangjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
330c5613
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
5 deletions
+17
-5
UserController.java
...n/quantgroup/xyqb/controller/external/UserController.java
+4
-2
AppController.java
...antgroup/xyqb/controller/internal/user/AppController.java
+3
-1
AppletServiceImpl.java
...b/service/middleoffice/applet/impl/AppletServiceImpl.java
+2
-1
SessionServiceImpl.java
...ntgroup/xyqb/service/session/impl/SessionServiceImpl.java
+2
-1
TenantUtil.java
src/main/java/cn/quantgroup/xyqb/util/TenantUtil.java
+6
-0
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/UserController.java
View file @
d726ca92
...
...
@@ -161,9 +161,10 @@ public class UserController implements IBaseController {
@RequestParam
(
required
=
false
)
Long
btRegisterChannelId
,
@RequestParam
(
required
=
false
)
String
dimension
,
@RequestParam
(
name
=
"click_id"
,
required
=
false
)
String
clickId
,
@RequestParam
(
required
=
false
,
defaultValue
=
"defualt"
)
String
tenantId
,
HttpServletRequest
request
)
{
log
.
info
(
"login/fastV1 -> channelId:{},ZappChennel:{},createdFrom:{},key:{},btRegisterChannelId:{},dimension:{},clickId:{}"
,
channelId
,
appChannel
,
createdFrom
,
key
,
btRegisterChannelId
,
dimension
,
clickId
);
return
loginFast
(
channelId
,
appChannel
,
createdFrom
,
key
,
btRegisterChannelId
,
dimension
,
clickId
,
request
);
return
loginFast
(
channelId
,
appChannel
,
createdFrom
,
key
,
btRegisterChannelId
,
dimension
,
clickId
,
tenantId
,
request
);
}
/**
...
...
@@ -180,6 +181,7 @@ public class UserController implements IBaseController {
@RequestParam
(
required
=
false
)
Long
btRegisterChannelId
,
@RequestParam
(
required
=
false
)
String
dimension
,
@RequestParam
(
name
=
"click_id"
,
required
=
false
)
String
clickId
,
@RequestParam
(
required
=
false
,
defaultValue
=
"defualt"
)
String
tenantId
,
HttpServletRequest
request
)
{
Map
<
String
,
JsonResult
>
validMap
=
getHeaderParam
(
request
);
log
.
info
(
"login/fast -> channelId:{},appChannel:{},createdFrom:{},btRegisterChannelId:{},key:{},dimension:{},clickId:{}"
,
channelId
,
appChannel
,
createdFrom
,
btRegisterChannelId
,
key
,
dimension
,
clickId
);
...
...
@@ -200,7 +202,7 @@ public class UserController implements IBaseController {
String
verificationCode
=
successResult
.
getMsg
();
// 执行短信验证码检查
verifyPhoneAndCodeForOnce
(
phoneNo
,
verificationCode
);
return
userService
.
loginFast
(
channelId
,
appChannel
,
createdFrom
,
btRegisterChannelId
,
dimension
,
clickId
,
request
,
merchant
,
phoneNo
);
return
userService
.
loginFast
(
channelId
,
appChannel
,
createdFrom
,
btRegisterChannelId
,
dimension
,
clickId
,
request
,
merchant
,
phoneNo
,
tenantId
);
}
/**
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/user/AppController.java
View file @
d726ca92
...
...
@@ -19,6 +19,7 @@ import cn.quantgroup.xyqb.service.user.IOauthClientDetailsService;
import
cn.quantgroup.xyqb.service.user.IOauthLoginInfoService
;
import
cn.quantgroup.xyqb.service.user.IUserService
;
import
cn.quantgroup.xyqb.util.IpUtil
;
import
cn.quantgroup.xyqb.util.TenantUtil
;
import
cn.quantgroup.xyqb.util.ValidationUtil
;
import
com.sensorsdata.analytics.javasdk.ISensorsAnalytics
;
import
com.sensorsdata.analytics.javasdk.bean.EventRecord
;
...
...
@@ -165,6 +166,7 @@ public class AppController implements IBaseController {
if
(
merchant
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
"无效的商户"
,
null
);
}
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
4
,
channelId
,
registerFrom
,
appChannel
,
merchant
.
getId
(),
merchant
.
getName
(),
null
);
AuthBean
bean
=
sessionService
.
createSession
(
user
,
loginProperties
);
log
.
info
(
"第三方用户登录成功 [AppController] login --> loginFrom:{}, phoneNo:{},appChannel:{}"
,
registerFrom
,
phoneNo
,
appChannel
);
...
...
@@ -315,7 +317,7 @@ public class AppController implements IBaseController {
return
JsonResult
.
buildErrorStateResult
(
"登录失败"
,
null
);
}
//校验租户ID tenantId
if
(!
tenantId
.
equals
(
"1"
))
{
if
(!
TenantUtil
.
TENANT_DEFAULT
.
equals
(
tenantId
))
{
oauthLoginInfoService
.
addLoginInfo
(
user
,
tenantId
);
}
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
4
,
channelId
,
registerFrom
,
appChannel
,
null
,
""
,
tenantId
);
...
...
src/main/java/cn/quantgroup/xyqb/service/middleoffice/applet/impl/AppletServiceImpl.java
View file @
d726ca92
...
...
@@ -11,6 +11,7 @@ import cn.quantgroup.xyqb.service.middleoffice.applet.IAppletService;
import
cn.quantgroup.xyqb.service.register.IUserRegisterService
;
import
cn.quantgroup.xyqb.service.user.IOauthLoginInfoService
;
import
cn.quantgroup.xyqb.service.user.IUserService
;
import
cn.quantgroup.xyqb.util.TenantUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -102,7 +103,7 @@ public class AppletServiceImpl implements IAppletService {
throw
new
AppletException
(
"未找到此用户"
,
"0401"
);
}
//校验租户ID tenantId
if
(!
"defualt"
.
equals
(
tenantId
))
{
if
(!
TenantUtil
.
TENANT_DEFAULT
.
equals
(
tenantId
))
{
iOauthLoginInfoService
.
addLoginInfo
(
user
,
tenantId
);
}
LoginVo
loginVo
=
loginModule
.
loginByUserId
(
user
.
getRegisteredFrom
(),
...
...
src/main/java/cn/quantgroup/xyqb/service/session/impl/SessionServiceImpl.java
View file @
d726ca92
...
...
@@ -10,6 +10,7 @@ import cn.quantgroup.xyqb.model.session.SessionValue;
import
cn.quantgroup.xyqb.service.session.ISessionService
;
import
cn.quantgroup.xyqb.service.session.aspect.UserBtRegisterFill
;
import
cn.quantgroup.xyqb.util.MqUtils
;
import
cn.quantgroup.xyqb.util.TenantUtil
;
import
com.alibaba.fastjson.JSON
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -103,7 +104,7 @@ public class SessionServiceImpl implements ISessionService {
* @return redisKey. 用来标识这个渠道的用户 Session 是否存在
*/
private
String
generateLoginPropertiesKey
(
Long
userId
,
LoginProperties
properties
)
{
if
(
properties
.
getTenantId
()
==
null
||
"defualt"
.
equals
(
properties
.
getTenantId
()))
{
if
(
properties
.
getTenantId
()
==
null
||
TenantUtil
.
TENANT_DEFAULT
.
equals
(
properties
.
getTenantId
()))
{
return
Constants
.
Session
.
USER_SESSION_ID_CACHE
+
":"
+
userId
+
":"
+
properties
.
getMerchantName
()
+
":"
+
properties
.
getCreatedFrom
();
}
else
{
return
Constants
.
Session
.
USER_SESSION_ID_CACHE
+
":"
+
userId
+
":"
+
properties
.
getMerchantName
()
+
":"
+
properties
.
getCreatedFrom
()
+
":"
+
properties
.
getTenantId
();
...
...
src/main/java/cn/quantgroup/xyqb/util/TenantUtil.java
0 → 100644
View file @
d726ca92
package
cn
.
quantgroup
.
xyqb
.
util
;
public
class
TenantUtil
{
public
static
final
String
TENANT_DEFAULT
=
"defualt"
;
}
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