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
09493ffe
Commit
09493ffe
authored
Apr 08, 2018
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录请求中:参数名openId被乱用,改为wechat_open_id,以是否存在该参数识别是否需要强制关联微信(会影响登录结果)
parent
27d358d3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
Constants.java
src/main/java/cn/quantgroup/xyqb/Constants.java
+1
-1
UserController.java
...ntgroup/xyqb/controller/internal/user/UserController.java
+3
-3
No files found.
src/main/java/cn/quantgroup/xyqb/Constants.java
View file @
09493ffe
...
@@ -29,7 +29,7 @@ public interface Constants {
...
@@ -29,7 +29,7 @@ public interface Constants {
/** 登录账号/手机号参数名 */
/** 登录账号/手机号参数名 */
String
PHONE_NO
=
"phoneNo"
;
String
PHONE_NO
=
"phoneNo"
;
/** 微信标识参数名 */
/** 微信标识参数名 */
String
OPEN_ID
=
"openI
d"
;
String
WECHAT_OPEN_ID
=
"wechat_open_i
d"
;
// -- Start -- IPV4安全策略常量组
// -- Start -- IPV4安全策略常量组
/** 账密不匹配错误 - 按账号计数 */
/** 账密不匹配错误 - 按账号计数 */
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/user/UserController.java
View file @
09493ffe
...
@@ -478,17 +478,17 @@ public class UserController implements IBaseController {
...
@@ -478,17 +478,17 @@ public class UserController implements IBaseController {
Objects
.
requireNonNull
(
request
,
"无效请求"
);
Objects
.
requireNonNull
(
request
,
"无效请求"
);
String
clientIp
=
IPUtil
.
getRemoteIP
(
request
);
String
clientIp
=
IPUtil
.
getRemoteIP
(
request
);
Set
<
String
>
paramKeys
=
request
.
getParameterMap
().
keySet
();
Set
<
String
>
paramKeys
=
request
.
getParameterMap
().
keySet
();
boolean
ready
=
paramKeys
.
contains
(
Constants
.
OPEN_ID
);
boolean
ready
=
paramKeys
.
contains
(
Constants
.
WECHAT_
OPEN_ID
);
if
(!
ready
){
if
(!
ready
){
return
true
;
return
true
;
}
else
if
(
Objects
.
isNull
(
user
)
||
Objects
.
isNull
(
user
.
getId
())
||
StringUtils
.
isBlank
(
request
.
getParameter
(
Constants
.
OPEN_ID
))){
}
else
if
(
Objects
.
isNull
(
user
)
||
Objects
.
isNull
(
user
.
getId
())
||
StringUtils
.
isBlank
(
request
.
getParameter
(
Constants
.
WECHAT_
OPEN_ID
))){
LOGGER
.
warn
(
"微信关联失败,user:{}, request-Header:{}"
,
user
,
JSON
.
toJSONString
(
getRequestHeaderMap
(
request
)));
LOGGER
.
warn
(
"微信关联失败,user:{}, request-Header:{}"
,
user
,
JSON
.
toJSONString
(
getRequestHeaderMap
(
request
)));
return
false
;
return
false
;
}
}
Long
userId
=
user
.
getId
();
Long
userId
=
user
.
getId
();
String
phoneNo
=
user
.
getPhoneNo
();
String
phoneNo
=
user
.
getPhoneNo
();
try
{
try
{
int
rows
=
wechatService
.
relateUser
(
userId
,
phoneNo
,
request
.
getParameter
(
Constants
.
OPEN_ID
));
int
rows
=
wechatService
.
relateUser
(
userId
,
phoneNo
,
request
.
getParameter
(
Constants
.
WECHAT_
OPEN_ID
));
return
rows
>
0
;
return
rows
>
0
;
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
LOGGER
.
error
(
"微信关联失败,user:{}, request-Header:{}"
,
user
,
JSON
.
toJSONString
(
getRequestHeaderMap
(
request
)),
e
);
LOGGER
.
error
(
"微信关联失败,user:{}, request-Header:{}"
,
user
,
JSON
.
toJSONString
(
getRequestHeaderMap
(
request
)),
e
);
...
...
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