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
a39186e1
Commit
a39186e1
authored
Dec 18, 2017
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
token 状态码
parent
85a6abd0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
Shop.php
application/api/controller/Shop.php
+11
-2
Basic.php
application/api/extend/Basic.php
+4
-4
No files found.
application/api/controller/Shop.php
View file @
a39186e1
...
...
@@ -10,6 +10,7 @@ namespace app\api\controller;
* Intro: 获取商铺list
*/
use
app\api\extend\Basic
;
use
app\model\AttentionModel
;
use
app\model\HouseImgs
;
use
app\model\HouseInfos
;
use
app\model\Labels
;
...
...
@@ -19,6 +20,7 @@ class Shop extends Basic
protected
$db
;
protected
$dbImg
;
protected
$labels
;
protected
$attentionModel
;
function
__construct
(
$request
=
null
)
{
...
...
@@ -26,6 +28,7 @@ class Shop extends Basic
$this
->
db
=
new
HouseInfos
();
$this
->
dbImg
=
new
HouseImgs
();
$this
->
labels
=
new
Labels
();
$this
->
attentionModel
=
new
AttentionModel
();
}
/**
...
...
@@ -167,8 +170,14 @@ class Shop extends Basic
return
$this
->
response
(
"101"
,
'此楼盘已下架'
);
}
//todo 查询关注门店
/* $attention["user_id"] =
getAttentionByUserIdAndHouseId($attention);*/
if
(
isset
(
$this
->
userId
))
{
$attention
[
"user_id"
]
=
$this
->
userId
;
$attention
[
"house_id"
]
=
$params
[
"id"
];
$attention
[
"is_del"
]
=
0
;
$attResult
=
$this
->
attentionModel
->
getAttentionByUserIdAndHouseId
(
$attention
);
if
(
count
(
$attResult
)
>
0
)
$result
[
"attention"
]
=
$attResult
[
"id"
];
}
return
$this
->
response
(
"200"
,
'request success'
,
$result
);
...
...
application/api/extend/Basic.php
View file @
a39186e1
...
...
@@ -65,7 +65,7 @@ class Basic extends Controller
}
elseif
(
strtoupper
(
$this
->
request
->
method
())
===
"POST"
)
{
$this
->
params
=
$this
->
request
->
param
()
!=
null
?
$this
->
request
->
param
()
:
null
;
}
if
(
isset
(
$this
->
params
[
'AuthToken'
]))
{
$jwt
=
new
\Firebase\JWT\JWT
();
$this
->
authToken
=
$this
->
params
[
'AuthToken'
];
...
...
@@ -89,7 +89,7 @@ class Basic extends Controller
*/
public
function
tokenVerify
(){
if
(
!
isset
(
$this
->
params
[
'AuthToken'
]))
{
echo
json_encode
(
array
(
"code"
=>
"
101
"
,
"msg"
=>
"AuthToken不能为空!"
,
"data"
=>
[],
"type"
=>
"json"
));
echo
json_encode
(
array
(
"code"
=>
"
300
"
,
"msg"
=>
"AuthToken不能为空!"
,
"data"
=>
[],
"type"
=>
"json"
));
exit
;
}
$this
->
verifyUserInfo
();
...
...
@@ -101,7 +101,7 @@ class Basic extends Controller
{
//authToken有效期为30天
if
((
time
()
-
$this
->
timeStamp_
)
>
2592000
)
{
echo
json_encode
(
array
(
"code"
=>
"
101
"
,
"msg"
=>
"AuthToken失效,请重新登录!"
,
"data"
=>
[],
"type"
=>
"json"
));
echo
json_encode
(
array
(
"code"
=>
"
300
"
,
"msg"
=>
"AuthToken失效,请重新登录!"
,
"data"
=>
[],
"type"
=>
"json"
));
exit
;
}
}
...
...
@@ -111,7 +111,7 @@ class Basic extends Controller
$userModel
=
new
Users
();
$userArr
=
$userModel
->
selectUser
(
$this
->
userId
);
if
(
count
(
$userArr
)
>
0
&&
(
$userArr
[
"id"
]
!=
$this
->
userId
||
$userArr
[
"user_phone"
]
!=
$this
->
phone
))
{
echo
json_encode
(
array
(
"code"
=>
"
101
"
,
"msg"
=>
"用户验证失败,重新登录!"
,
"data"
=>
[],
"type"
=>
"json"
));
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