Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
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
hujun
tl_estate
Commits
ed76aff3
Commit
ed76aff3
authored
Mar 01, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注释用户数据库验证
parent
60c9aeb6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
Broker.php
application/api_broker/controller/Broker.php
+1
-1
Basic.php
application/api_broker/extend/Basic.php
+3
-2
No files found.
application/api_broker/controller/Broker.php
View file @
ed76aff3
...
...
@@ -365,7 +365,7 @@ class Broker extends Basic
*/
public
function
getAgentsByPhone
()
{
$agents
=
new
Agents
();
$data
=
$agents
->
getInfo
(
$this
->
params
[
'phone'
]
);
$data
=
$agents
->
getInfo
(
$this
->
agentPhone
);
$data
[
'openid'
]
=
""
;
$data
[
'token'
]
=
$this
->
authToken
;
return
$this
->
response
(
200
,
""
,
$data
);
...
...
application/api_broker/extend/Basic.php
View file @
ed76aff3
...
...
@@ -64,6 +64,7 @@ class Basic extends Controller
}
elseif
(
strtoupper
(
$this
->
request
->
method
())
===
"POST"
)
{
$this
->
params
=
$this
->
request
->
param
()
!=
null
?
$this
->
request
->
param
()
:
null
;
}
/*临时验证 start*/
if
(
isset
(
$this
->
params
[
'AuthToken'
])
&&
$this
->
params
[
'AuthToken'
]
!=
'null'
&&
!
empty
(
$this
->
params
[
'AuthToken'
]))
{
$jwt
=
new
\Firebase\JWT\JWT
();
...
...
@@ -71,7 +72,7 @@ class Basic extends Controller
$result
=
$jwt
->
decode
(
$this
->
authToken
,
config
(
'jwt_key'
),
array
(
'HS256'
));
//解码token
$this
->
timeStamp_
=
$result
->
timeStamp_
;
$is
=
Db
::
table
(
'agents'
)
->
where
(
'phone'
,
$result
->
data
)
->
count
();
$this
->
agentPhone
=
$result
->
data
;
if
(
$is
==
0
)
{
echo
json_encode
(
array
(
"code"
=>
"300"
,
"msg"
=>
"用户验证失败,重新登录!"
,
"data"
=>
[],
"type"
=>
"json"
));
exit
;
...
...
@@ -112,7 +113,7 @@ class Basic extends Controller
echo
json_encode
(
array
(
"code"
=>
"300"
,
"msg"
=>
"AuthToken不能为空!"
,
"data"
=>
[],
"type"
=>
"json"
));
exit
;
}
$this
->
verifyAgentInfo
();
//
$this->verifyAgentInfo();
$this
->
verifyTime
();
}
...
...
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