Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
brandkbs2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
shenjunjie
brandkbs2
Commits
ef1f5f0e
Commit
ef1f5f0e
authored
Mar 20, 2023
by
shenjunjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加手机号解析打印
parent
3e8f2122
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/UserServiceImpl.java
+5
-1
src/main/resources/application.properties
+1
-1
No files found.
src/main/java/com/zhiwei/brandkbs2/service/impl/UserServiceImpl.java
View file @
ef1f5f0e
...
...
@@ -25,6 +25,8 @@ import com.zhiwei.brandkbs2.util.MongoUtil;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.middleware.auth.pojo.CenterUser
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.mongodb.core.query.Criteria
;
...
...
@@ -48,6 +50,7 @@ import java.util.stream.Collectors;
*/
@Service
(
"userServiceImpl"
)
public
class
UserServiceImpl
implements
UserService
{
public
static
final
Logger
log
=
LogManager
.
getLogger
(
UserServiceImpl
.
class
);
@Resource
(
name
=
"userDao"
)
private
UserDao
userDao
;
...
...
@@ -363,8 +366,9 @@ public class UserServiceImpl implements UserService {
info
.
put
(
"code"
,
loginVO
.
getCode
());
HttpEntity
<
JSONObject
>
phoneNumberEntity
=
restTemplate
.
postForEntity
(
wxGetUserPhoneNumberUrl
+
accessToken
,
info
,
JSONObject
.
class
);
if
(
null
==
phoneNumberEntity
.
getBody
())
{
return
ResponseResult
.
failure
(
"手机号
获取
失败"
);
return
ResponseResult
.
failure
(
"手机号
解析
失败"
);
}
log
.
info
(
"解析手机号,accessToken:{},wxGetUserPhoneNumberUrl:{},response:{}"
,
accessToken
,
wxGetUserPhoneNumberUrl
,
phoneNumberEntity
.
getBody
());
phoneNumber
=
Long
.
valueOf
(
phoneNumberEntity
.
getBody
().
getJSONObject
(
"phone_info"
).
getString
(
"purePhoneNumber"
));
}
User
user
=
userDao
.
findOne
(
"phoneNumber"
,
phoneNumber
);
...
...
src/main/resources/application.properties
View file @
ef1f5f0e
spring.profiles.active
=
prod
spring.profiles.active
=
local
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