mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-05-22 14:59:14 +08:00
Update Auth.php
This commit is contained in:
parent
eaafaf8a10
commit
63f53710fb
@ -29,14 +29,13 @@ abstract class Auth extends Controller
|
|||||||
* 当前接口类型
|
* 当前接口类型
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $type = 'wxapp';
|
protected $type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 控制器初始化
|
* 控制器初始化
|
||||||
*/
|
*/
|
||||||
protected function initialize()
|
protected function initialize()
|
||||||
{
|
{
|
||||||
$this->type = input('api', 'web');
|
|
||||||
$this->user = $this->getUser();
|
$this->user = $this->getUser();
|
||||||
$this->uuid = $this->user['id'];
|
$this->uuid = $this->user['id'];
|
||||||
}
|
}
|
||||||
@ -49,6 +48,7 @@ abstract class Auth extends Controller
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$user = UserService::instance();
|
$user = UserService::instance();
|
||||||
|
$this->type = input('api', 'web');
|
||||||
if (empty($this->uuid)) {
|
if (empty($this->uuid)) {
|
||||||
$token = input('token') ?: $this->request->header('token');
|
$token = input('token') ?: $this->request->header('token');
|
||||||
if (empty($token)) $this->error('接口认证令牌不能为空!');
|
if (empty($token)) $this->error('接口认证令牌不能为空!');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user