Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
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
bp
goods
Commits
9b2fd912
Commit
9b2fd912
authored
Sep 29, 2021
by
jianghaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:修改
parent
6e3d59cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
UserService.php
application/services/user/UserService.php
+6
-6
No files found.
application/services/user/UserService.php
View file @
9b2fd912
...
...
@@ -22,7 +22,7 @@ class UserService
private
static
$code
=
''
;
private
static
$grantType
=
'authorization_code'
;
private
static
$loginUrl
=
'https://api.weixin.qq.com/sns/jscode2session'
;
private
static
$
appi
d
=
''
;
private
static
$
wechatAppI
d
=
''
;
private
static
$secret
=
""
;
private
static
$redis
=
""
;
private
static
$keyCode
=
""
;
...
...
@@ -64,7 +64,7 @@ class UserService
'activity_type'
=>
$activityType
,
'create_time'
=>
date
(
"Y-m-d H:i:s"
),
'appid'
=>
$appid
,
'wechat_app_id'
=>
self
::
$
appi
d
,
'wechat_app_id'
=>
self
::
$
wechatAppI
d
,
];
$sessionKey
=
!
empty
(
$response
[
'session_key'
])
?
$response
[
'session_key'
]
:
''
;
...
...
@@ -123,7 +123,7 @@ class UserService
public
static
function
setWechatConfig
(
$wechatFrom
)
{
//需要授权微信
self
::
$
appi
d
=
\Yaf\Registry
::
get
(
'config'
)
->
wechat
->
appid
->
$wechatFrom
;
self
::
$
wechatAppI
d
=
\Yaf\Registry
::
get
(
'config'
)
->
wechat
->
appid
->
$wechatFrom
;
self
::
$secret
=
\Yaf\Registry
::
get
(
'config'
)
->
wechat
->
secret
->
$wechatFrom
;
}
...
...
@@ -159,7 +159,7 @@ class UserService
public
static
function
getJscode2session
(){
//请求接口,获取用户openid
$params
=
[
'appid'
=>
self
::
$
appi
d
,
'appid'
=>
self
::
$
wechatAppI
d
,
'secret'
=>
self
::
$secret
,
'js_code'
=>
self
::
$code
,
'grant_type'
=>
self
::
$grantType
,
...
...
@@ -299,7 +299,7 @@ class UserService
//解密
$decryptData
=
[];
$wXBizDataCrypt
=
new
WxBizDataCrypt
(
self
::
$
appi
d
,
$sessionKey
);
$wXBizDataCrypt
=
new
WxBizDataCrypt
(
self
::
$
wechatAppI
d
,
$sessionKey
);
$errCode
=
$wXBizDataCrypt
->
decryptData
(
$encryptedData
,
$iv
,
$decryptData
);
if
(
$errCode
)
{
...
...
@@ -319,7 +319,7 @@ class UserService
if
(
$params
[
'appid'
]
==
'merchant-pub-pin'
)
{
$user
=
UserWechatBind
::
getRecordMaster
([
'phone'
=>
$phoneNumber
]);
}
else
{
$user
=
UserWechatBind
::
getRecordMaster
([
'phone'
=>
$phoneNumber
,
'wechat_app_id'
=>
self
::
$
appi
d
]);
$user
=
UserWechatBind
::
getRecordMaster
([
'phone'
=>
$phoneNumber
,
'wechat_app_id'
=>
self
::
$
wechatAppI
d
]);
}
if
(
!
empty
(
$user
)
&&
$openid
!=
$user
[
'openid'
])
{
...
...
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