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
d3836a8d
Commit
d3836a8d
authored
Feb 08, 2017
by
zhouqian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OK
parent
e605ec55
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
+20
-12
UserController.java
...ntgroup/xyqb/controller/internal/user/UserController.java
+19
-11
RequestFilter.java
src/main/java/cn/quantgroup/xyqb/filter/RequestFilter.java
+1
-1
No files found.
src/main/java/cn/quantgroup/xyqb/controller/internal/user/UserController.java
View file @
d3836a8d
...
...
@@ -446,22 +446,30 @@ public class UserController implements IBaseController {
}
@RequestMapping
(
"/associate_wechat"
)
public
JsonResult
associateWithWechat
(
String
openId
,
String
phoneNo
)
{
public
JsonResult
associateWithWechat
(
String
openId
)
{
User
user
=
getCurrentUser
();
Long
userId
=
user
.
getId
();
WechatUserInfo
wechatUserInfo
=
wechatService
.
findWechatUserInfoByPhoneNo
(
phoneNo
);
if
(
wechatUserInfo
!=
null
)
{
return
JsonResult
.
buildErrorStateResult
(
"该手机号已绑定其他微信号码"
,
null
);
}
WechatUserInfo
userInfo
=
wechatService
.
findWechatUserInfoFromDb
(
openId
);
if
(!
user
.
getPhoneNo
().
equals
(
phoneNo
))
{
return
JsonResult
.
buildErrorStateResult
(
"该手机号已绑定其他微信号码"
,
null
);
// 已经绑定过了
if
(
userInfo
!=
null
&&
StringUtils
.
isNotEmpty
(
userInfo
.
getPhoneNo
()))
{
return
JsonResult
.
buildSuccessResult
(
null
,
null
);
}
// 前置绑定微信出错
if
(
userInfo
==
null
)
{
return
JsonResult
.
buildSuccessResult
(
null
,
null
);
}
//
限制微信用户和xyqb用户为一对一的关系
if
(
userInfo
!
=
null
)
{
//
未绑定信用钱包用户
if
(
userInfo
.
getUserId
()
=
=
null
)
{
userInfo
.
setUserId
(
userId
);
userInfo
.
setPhoneNo
(
phoneNo
);
userInfo
.
setPhoneNo
(
user
.
getPhoneNo
());
try
{
wechatService
.
saveWechatUserInfo
(
userInfo
);
}
catch
(
Exception
ex
)
{
// 不做绑定
JsonResult
.
buildErrorStateResult
(
"该手机号已绑定其他微信号码"
,
null
);
}
return
JsonResult
.
buildSuccessResult
(
null
,
null
);
}
return
JsonResult
.
buildSuccessResult
(
null
,
null
);
}
...
...
src/main/java/cn/quantgroup/xyqb/filter/RequestFilter.java
View file @
d3836a8d
...
...
@@ -31,7 +31,7 @@ public class RequestFilter implements Filter {
private
AntPathMatcher
matcher
=
new
AntPathMatcher
();
private
static
final
String
[]
ALLOWED_PATTERNS
=
{
"/innerapi/**"
,
"/user/exist"
,
"/user/register"
,
"/user/login"
,
"/user/register/fast"
,
"/user/login/fast"
,
"/user/reset_password"
,
"/user/exist_check"
,
"/user/associate_wechat"
,
"/user/login/fast"
,
"/user/reset_password"
,
"/user/exist_check"
,
"/jr58/**"
,
"/app/login"
,
"/app/login_super"
,
"/wechat/**"
,
"/config/**"
,
"/api/**"
,
"/user/exists_token"
,
"/platform/api/page/return_url"
,
"/MP_verify_AWiagUn4kZiwmTt0.txt"
};
...
...
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