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
32771c62
Commit
32771c62
authored
Aug 07, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
28e15be6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
Basic.php
application/api_broker/extend/Basic.php
+14
-10
No files found.
application/api_broker/extend/Basic.php
View file @
32771c62
...
...
@@ -82,10 +82,10 @@ class Basic extends Controller
try
{
$result
=
$jwt
->
decode
(
$this
->
params
[
'AuthToken'
],
config
(
'jwt_key'
),
array
(
'HS256'
));
//解码token
}
catch
(
UnexpectedValueException
$e
)
{
}
catch
(
UnexpectedValueException
$e
)
{
echo
json_encode
(
array
(
"code"
=>
"300"
,
"msg"
=>
"AuthToken参数错误!"
,
"data"
=>
[],
"type"
=>
"json"
));
exit
;
}
catch
(
InvalidArgumentException
$e
)
{
}
catch
(
InvalidArgumentException
$e
)
{
echo
json_encode
(
array
(
"code"
=>
"300"
,
"msg"
=>
"AuthToken参数错误!"
,
"data"
=>
[],
"type"
=>
"json"
));
exit
;
}
...
...
@@ -112,11 +112,13 @@ class Basic extends Controller
* 默认城市选择
* @param $agentId
*/
public
function
getCity
(
$agentId
){
public
function
getCity
(
$agentId
)
{
$redis_
=
RedisExt
::
getRedis
();
if
(
$redis_
){
$this
->
city
=
$redis_
->
get
(
"agent_city_"
.
$agentId
);
}
else
{
if
(
$redis_
)
{
$city
=
$redis_
->
get
(
"agent_city_"
.
$agentId
);
$this
->
city
=
empty
(
$city
)
?
"上海"
:
$city
;
}
else
{
$this
->
city
=
"上海"
;
}
...
...
@@ -156,8 +158,8 @@ class Basic extends Controller
$agentModel
=
new
AAgents
();
$params
[
"status"
]
=
0
;
$params
[
"id"
]
=
$this
->
agentId
;
$agentArr
=
$agentModel
->
getAgentById
(
"id,store_id,name,phone"
,
$params
);
if
(
count
(
$agentArr
)
>
0
&&
(
$agentArr
[
"id"
]
!=
$this
->
agentId
))
{
$agentArr
=
$agentModel
->
getAgentById
(
"id,store_id,name,phone"
,
$params
);
if
(
count
(
$agentArr
)
>
0
&&
(
$agentArr
[
"id"
]
!=
$this
->
agentId
))
{
echo
json_encode
(
array
(
"code"
=>
"300"
,
"msg"
=>
"用户验证失败,重新登录!"
,
"data"
=>
[],
"type"
=>
"json"
));
exit
;
}
...
...
@@ -307,7 +309,8 @@ class Basic extends Controller
* @param $requestPath
* @return bool
*/
public
function
userAuth
(
$requestPath
){
public
function
userAuth
(
$requestPath
)
{
$agents
=
new
AAgents
();
$is_auth
=
$agents
->
agentsAuthId
(
$this
->
agentId
,
$requestPath
);
...
...
@@ -323,7 +326,8 @@ class Basic extends Controller
];
if
(
in_array
(
$requestPath
,
$auth_arr
)
&&
empty
(
$is_auth
)
&&
$this
->
agentId
!=
1
)
{
echo
json_encode
(
array
(
"code"
=>
"300"
,
"msg"
=>
"没有权限!"
,
"data"
=>
[],
"type"
=>
"json"
));
exit
;
echo
json_encode
(
array
(
"code"
=>
"300"
,
"msg"
=>
"没有权限!"
,
"data"
=>
[],
"type"
=>
"json"
));
exit
;
}
return
true
;
...
...
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