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
0ff7cb1d
Commit
0ff7cb1d
authored
Jul 13, 2023
by
王亮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update previous code.(LoginProperties tenantId)
parent
4af777a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
UserController.java
...n/quantgroup/xyqb/controller/external/UserController.java
+3
-3
WeChatController.java
...quantgroup/xyqb/controller/external/WeChatController.java
+7
-7
AppController.java
...antgroup/xyqb/controller/internal/user/AppController.java
+2
-2
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/UserController.java
View file @
0ff7cb1d
...
...
@@ -722,7 +722,7 @@ public class UserController implements IBaseController {
}
else
if
(!
wechatRelateUserIfNecessary
(
user
,
request
,
appId
,
tenantId
))
{
return
JsonResult
.
buildErrorStateResult
(
"登录时微信关联失败"
,
null
);
}
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
1
,
channelId
,
createdFrom
,
appChannel
,
merchant
.
getId
(),
merchant
.
getName
(),
null
);
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
1
,
channelId
,
createdFrom
,
appChannel
,
merchant
.
getId
(),
merchant
.
getName
(),
tenantId
);
AuthBean
authBean
=
sessionService
.
createSession
(
user
,
loginProperties
,
LoginType
.
ACCOUNTPASSWORD
.
ordinal
(),
tenantId
);
if
(
authBean
!=
null
)
{
authBean
.
setRegister
(
false
);
...
...
@@ -808,7 +808,7 @@ public class UserController implements IBaseController {
}
else
if
(!
wechatRelateUserIfNecessary
(
user
,
request
,
appId
,
tenantId
))
{
return
JsonResult
.
buildErrorStateResult
(
"登录时微信关联失败"
,
null
);
}
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
4
,
channelId
,
createdFrom
,
appChannel
,
merchant
.
getId
(),
merchant
.
getName
(),
null
);
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
4
,
channelId
,
createdFrom
,
appChannel
,
merchant
.
getId
(),
merchant
.
getName
(),
tenantId
);
//尝试解锁
lockIpv4Service
.
unLockPhone
(
user
.
getEncryptedPhoneNo
());
...
...
@@ -916,7 +916,7 @@ public class UserController implements IBaseController {
return
JsonResult
.
buildErrorStateResult
(
"未知的连接"
,
null
);
}
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
4
,
channelId
,
createdFrom
,
appChannel
,
merchant
.
getId
(),
merchant
.
getName
(),
null
);
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
4
,
channelId
,
createdFrom
,
appChannel
,
merchant
.
getId
(),
merchant
.
getName
(),
tenantId
);
try
{
userService
.
kdspLogout
(
userId
,
loginProperties
,
tenantId
);
}
catch
(
Exception
e
)
{
...
...
src/main/java/cn/quantgroup/xyqb/controller/external/WeChatController.java
View file @
0ff7cb1d
...
...
@@ -299,7 +299,7 @@ public class WeChatController implements IBaseController {
}
// 已经关联了用户
// create session, 登进去,该怎么玩怎么玩。
String
redirectUrl
=
createUserSession
(
user
,
merchant
,
redirect
,
domain
,
registerFrom
);
String
redirectUrl
=
createUserSession
(
user
,
merchant
,
redirect
,
domain
,
registerFrom
,
tenantId
);
response
.
setHeader
(
"Location"
,
redirectUrl
);
response
.
setStatus
(
HttpStatus
.
SC_MOVED_PERMANENTLY
);
}
...
...
@@ -359,18 +359,18 @@ public class WeChatController implements IBaseController {
receiveCodeWithDefault
(
code
,
systemKey
,
schema
,
registerFrom
,
redirect
,
redirect
,
response
,
appId
,
tenantId
);
}
private
String
createUserSession
(
User
user
,
Merchant
merchant
,
String
redirect
,
String
domain
,
Long
registerFrom
)
{
private
String
createUserSession
(
User
user
,
Merchant
merchant
,
String
redirect
,
String
domain
,
Long
registerFrom
,
Integer
tenantId
)
{
log
.
info
(
"[WeChatController][createUserSession]微信授权及跳转:user:{},merchant:{},redirect:{},domain:{},registerFrom:{}"
,
user
,
merchant
,
redirect
,
domain
,
registerFrom
);
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
4
,
Constants
.
Channel
.
WECHAT
,
registerFrom
,
String
.
valueOf
(
Constants
.
Channel
.
WECHAT
),
merchant
.
getId
(),
merchant
.
getName
(),
null
);
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
4
,
Constants
.
Channel
.
WECHAT
,
registerFrom
,
String
.
valueOf
(
Constants
.
Channel
.
WECHAT
),
merchant
.
getId
(),
merchant
.
getName
(),
tenantId
);
if
(
StringUtils
.
isEmpty
(
redirect
)
||
Constants
.
REDIRECT
.
equals
(
redirect
))
{
log
.
info
(
"微信登录:redirect为null,走正常流程."
);
if
(
Constants
.
MERCHANT_BAITIAO
.
equals
(
merchant
.
getName
()))
{
return
loginInWechatWithSessionCreated
(
user
,
merchant
,
"cashTarget5"
,
Constants
.
Channel
.
BAITIAO
,
domain
,
Constants
.
Channel
.
WECHAT
);
return
loginInWechatWithSessionCreated
(
user
,
merchant
,
"cashTarget5"
,
Constants
.
Channel
.
BAITIAO
,
domain
,
Constants
.
Channel
.
WECHAT
,
tenantId
);
}
else
if
(
Constants
.
MERCHANT_WECHAT_PAY
.
equals
(
merchant
.
getName
()))
{
AuthBean
authBean
=
sessionService
.
createSession
(
user
,
loginProperties
,
LoginType
.
WECHATLOGIN
.
ordinal
(),
user
.
getTenantId
());
return
domain
+
"/landing?token="
+
authBean
.
getToken
()
+
"®isterFrom="
+
registerFrom
+
"&channelId="
+
Constants
.
Channel
.
WECHAT
+
"&key="
+
merchant
.
getName
()
+
"&target=cashTarget5"
;
}
else
{
return
loginInWechatWithSessionCreated
(
user
,
merchant
,
"cashTarget4"
,
1L
,
domain
,
registerFrom
);
return
loginInWechatWithSessionCreated
(
user
,
merchant
,
"cashTarget4"
,
1L
,
domain
,
registerFrom
,
tenantId
);
}
}
else
if
(
Constants
.
LOCAL
.
equals
(
redirect
))
{
log
.
info
(
"微信登录:redirect不为null,创建session跳到指定前端页面."
);
...
...
@@ -388,8 +388,8 @@ public class WeChatController implements IBaseController {
return
null
;
}
private
String
loginInWechatWithSessionCreated
(
User
user
,
Merchant
merchant
,
String
target
,
Long
channelId
,
String
domain
,
Long
registerFrom
)
{
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
4
,
channelId
,
registerFrom
,
String
.
valueOf
(
Constants
.
Channel
.
WECHAT
),
merchant
.
getId
(),
merchant
.
getName
(),
null
);
private
String
loginInWechatWithSessionCreated
(
User
user
,
Merchant
merchant
,
String
target
,
Long
channelId
,
String
domain
,
Long
registerFrom
,
Integer
tenantId
)
{
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
4
,
channelId
,
registerFrom
,
String
.
valueOf
(
Constants
.
Channel
.
WECHAT
),
merchant
.
getId
(),
merchant
.
getName
(),
tenantId
);
AuthBean
authBean
=
sessionService
.
createSession
(
user
,
loginProperties
,
LoginType
.
WECHATLOGIN
.
ordinal
(),
user
.
getTenantId
());
log
.
info
(
"[WeChatController][loginInWechatWithSessionCreated]微信授权及跳转:user:{},merchant:{},target:{},channelId:{},domain:{},registerFrom:{}"
,
user
,
merchant
,
target
,
channelId
,
domain
,
registerFrom
);
return
domain
+
"/landing?token="
+
authBean
.
getToken
()
+
"®isterFrom="
+
registerFrom
+
"&channelId="
+
channelId
+
"&key="
+
merchant
.
getName
()
+
"&target="
+
target
;
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/user/AppController.java
View file @
0ff7cb1d
...
...
@@ -106,7 +106,7 @@ public class AppController implements IBaseController {
if
(
merchant
==
null
)
{
result
=
JsonResult
.
buildErrorStateResult
(
"无效的商户"
,
null
);
}
else
{
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
4
,
channelId
,
registerFrom
,
appChannel
,
merchant
.
getId
(),
merchant
.
getName
(),
null
);
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
4
,
channelId
,
registerFrom
,
appChannel
,
merchant
.
getId
(),
merchant
.
getName
(),
tenantId
);
AuthBean
bean
=
sessionService
.
createSession
(
user
,
loginProperties
,
LoginType
.
AUTHLOGIN
.
ordinal
(),
tenantId
);
LoginInfo
.
LoginContext
context
=
new
LoginInfo
.
LoginContext
();
context
.
setChannelId
(
channelId
);
...
...
@@ -176,7 +176,7 @@ public class AppController implements IBaseController {
return
JsonResult
.
buildErrorStateResult
(
"无效的商户"
,
null
);
}
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
4
,
channelId
,
registerFrom
,
appChannel
,
merchant
.
getId
(),
merchant
.
getName
(),
null
);
LoginProperties
loginProperties
=
new
LoginProperties
(
""
,
4
,
channelId
,
registerFrom
,
appChannel
,
merchant
.
getId
(),
merchant
.
getName
(),
tenantId
);
AuthBean
bean
=
sessionService
.
createSession
(
user
,
loginProperties
,
LoginType
.
SUPERLOGIN
.
ordinal
(),
tenantId
);
log
.
info
(
"第三方用户登录成功 [AppController] login --> loginFrom:{}, phoneNo:{},appChannel:{}"
,
registerFrom
,
phoneNo
,
appChannel
);
return
JsonResult
.
buildSuccessResult
(
"登录成功"
,
bean
);
...
...
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