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
faa0efb7
Commit
faa0efb7
authored
Aug 10, 2021
by
jianghaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:Set
parent
0674f903
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
UserException.php
application/exception/custom/UserException.php
+1
-0
UserService.php
application/services/user/UserService.php
+10
-1
No files found.
application/exception/custom/UserException.php
View file @
faa0efb7
...
@@ -20,5 +20,6 @@ class UserException extends BaseException
...
@@ -20,5 +20,6 @@ class UserException extends BaseException
6
=>
'解密失败 不存在'
,
6
=>
'解密失败 不存在'
,
7
=>
'手机号获取失败'
,
7
=>
'手机号获取失败'
,
8
=>
'绑定手机号失败'
,
8
=>
'绑定手机号失败'
,
9
=>
'该手机号已绑定其他用户不能重复绑定'
,
];
];
}
}
\ No newline at end of file
application/services/user/UserService.php
View file @
faa0efb7
...
@@ -117,6 +117,9 @@ class UserService
...
@@ -117,6 +117,9 @@ class UserService
//解密
//解密
$decryptData
=
[];
$decryptData
=
[];
$wXBizDataCrypt
=
new
WxBizDataCrypt
(
$appid
,
$sessionKey
);
$wXBizDataCrypt
=
new
WxBizDataCrypt
(
$appid
,
$sessionKey
);
...
@@ -136,6 +139,12 @@ class UserService
...
@@ -136,6 +139,12 @@ class UserService
$phoneNumber
=
strval
(
$decryptData
[
'phoneNumber'
]);
$phoneNumber
=
strval
(
$decryptData
[
'phoneNumber'
]);
//判断是否已
$user
=
UserWechatBind
::
getRecord
([
'phone'
=>
$phoneNumber
]);
if
(
!
empty
(
$user
)
&&
$openid
!=
$user
[
'openid'
])
{
throw
new
UserException
([
'cus'
=>
9
]);
}
$jwUser
=
(
new
JwUser
())
->
getUserInfo
([
'mobile'
=>
$phoneNumber
]);
$jwUser
=
(
new
JwUser
())
->
getUserInfo
([
'mobile'
=>
$phoneNumber
]);
$userId
=
''
;
$userId
=
''
;
if
(
!
empty
(
$jwUser
[
'data'
]))
{
if
(
!
empty
(
$jwUser
[
'data'
]))
{
...
@@ -155,7 +164,7 @@ class UserService
...
@@ -155,7 +164,7 @@ class UserService
}
}
$userInfo
[
'user_id'
]
=
$userId
;
$userInfo
[
'user_id'
]
=
$userId
;
$userInfo
[
'phone'
]
=
$phoneNumber
;
$userInfo
[
'phone'
]
=
$phoneNumber
;
$userInfo
[
'is_pop_up'
]
=
1
;
$userInfo
[
'is_pop_up'
]
=
!
empty
(
$user
)
?
0
:
1
;
$userInfo
[
'pop_up_text'
]
=
""
;
$userInfo
[
'pop_up_text'
]
=
""
;
return
$userInfo
;
return
$userInfo
;
}
}
...
...
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