Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
on-site-service
Project
Project
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
external
on-site-service
Commits
97b59ab1
Commit
97b59ab1
authored
Jul 19, 2022
by
shangtx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 小程序登录暂不获取unionid
parent
502cf394
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
application-third-service.yaml
constant/src/main/resources/application-third-service.yaml
+1
-1
WeiXinService.java
...m/onsiteservice/miniapp/service/weixin/WeiXinService.java
+3
-3
No files found.
constant/src/main/resources/application-third-service.yaml
View file @
97b59ab1
...
...
@@ -42,7 +42,7 @@ wx:
# secret: d5e1aeae4fa4daa6328a6a02ddafb9ff #公众号的appsecret
# 微信支付
pay
:
appId
:
wx
a56f0845ca456bac
#微信公众号或者小程序等的appid
appId
:
wx
f4a024bdaacf6d70
#微信公众号或者小程序等的appid
mchId
:
1602411974
#微信支付商户号
# 公众号
###
...
...
mini-app/src/main/java/com/onsiteservice/miniapp/service/weixin/WeiXinService.java
View file @
97b59ab1
...
...
@@ -67,9 +67,9 @@ public class WeiXinService {
return
fail
(
"微信用户信息校验失败"
);
}
if
(
StringUtils
.
isBlank
(
unionId
))
{
/*
if (StringUtils.isBlank(unionId)) {
return fail("unionId无法获取,登录失败");
}
}
*/
// 解密用户信息
WxMaUserInfo
userInfo
=
wxMaService
.
getUserService
().
getUserInfo
(
sessionKey
,
loginDTO
.
getEncryptedData
(),
loginDTO
.
getIv
());
...
...
@@ -77,7 +77,7 @@ public class WeiXinService {
String
avatarUrl
=
userInfo
.
getAvatarUrl
();
// 是否存在用户
Optional
<
User
>
hasUser
=
Optional
.
ofNullable
(
userService
.
selectOneByProperty
(
"
unionId"
,
unio
nId
));
Optional
<
User
>
hasUser
=
Optional
.
ofNullable
(
userService
.
selectOneByProperty
(
"
openId"
,
ope
nId
));
if
(
hasUser
.
isPresent
())
{
User
user
=
hasUser
.
get
();
user
.
setNickName
(
nickName
);
...
...
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