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
9c2a789f
Commit
9c2a789f
authored
Aug 14, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
660ecf0a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
Shop.php
application/api/controller/Shop.php
+0
-0
Basic.php
application/api/extend/Basic.php
+29
-1
No files found.
application/api/controller/Shop.php
View file @
9c2a789f
This diff is collapsed.
Click to expand it.
application/api/extend/Basic.php
View file @
9c2a789f
...
@@ -9,8 +9,11 @@ namespace app\api\extend;
...
@@ -9,8 +9,11 @@ namespace app\api\extend;
* Time: 9:35
* Time: 9:35
* 基类
* 基类
*/
*/
use
app\extra\RedisExt
;
use
app\model\Users
;
use
app\model\Users
;
use
think\Controller
;
use
think\Controller
;
use
think\Exception
;
use
Think\Log
;
use
think\Request
;
use
think\Request
;
use
think\Response
;
use
think\Response
;
use
Qiniu
;
use
Qiniu
;
...
@@ -27,6 +30,8 @@ class Basic extends Controller
...
@@ -27,6 +30,8 @@ class Basic extends Controller
public
$params
;
public
$params
;
public
$user_city
;
protected
$authToken
;
protected
$authToken
;
/**
/**
...
@@ -37,7 +42,7 @@ class Basic extends Controller
...
@@ -37,7 +42,7 @@ class Basic extends Controller
protected
$phone
;
protected
$phone
;
protected
$timeStamp_
;
protected
$timeStamp_
;
protected
$filterVerify
=
array
(
protected
$filterVerify
=
array
(
"api/
shopDetail
"
,
"api/
getShopList
"
,
"api/sendSms"
,
"api/sendSms"
,
"api/sendCode"
,
"api/sendCode"
,
"api/userVerify"
,
"api/userVerify"
,
...
@@ -98,6 +103,8 @@ class Basic extends Controller
...
@@ -98,6 +103,8 @@ class Basic extends Controller
$this
->
timeStamp_
=
$result
->
timeStamp_
;
$this
->
timeStamp_
=
$result
->
timeStamp_
;
}
}
//$this->getCity($this->userId);
$requestPath
=
$this
->
request
->
routeInfo
()[
"rule"
][
0
]
.
"/"
.
$this
->
request
->
routeInfo
()[
"rule"
][
1
];
$requestPath
=
$this
->
request
->
routeInfo
()[
"rule"
][
0
]
.
"/"
.
$this
->
request
->
routeInfo
()[
"rule"
][
1
];
//过滤掉不需要验证token的接口
//过滤掉不需要验证token的接口
if
(
!
in_array
(
trim
(
$requestPath
),
$this
->
filterVerify
))
{
if
(
!
in_array
(
trim
(
$requestPath
),
$this
->
filterVerify
))
{
...
@@ -105,6 +112,27 @@ class Basic extends Controller
...
@@ -105,6 +112,27 @@ class Basic extends Controller
}
}
}
}
/**
* 默认城市选择
* @param $userId
*/
public
function
getCity
(
$userId
)
{
try
{
$redis_
=
RedisExt
::
getRedis
();
if
(
$redis_
)
{
$city
=
$redis_
->
get
(
"user_city_"
.
$userId
);
$this
->
user_city
=
empty
(
$city
)
?
"上海市"
:
$city
;
}
else
{
$this
->
user_city
=
"上海市"
;
}
Log
::
record
(
"-------basic-------"
.
$redis_
->
get
(
"user_city_"
.
$userId
),
"info"
);
}
catch
(
Exception
$exception
)
{
$this
->
user_city
=
"上海市"
;
}
}
/**
/**
* token 验证
* token 验证
*/
*/
...
...
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