mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-05-22 06:49:15 +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
|
||||
*/
|
||||
protected $type = 'wxapp';
|
||||
protected $type;
|
||||
|
||||
/**
|
||||
* 控制器初始化
|
||||
*/
|
||||
protected function initialize()
|
||||
{
|
||||
$this->type = input('api', 'web');
|
||||
$this->user = $this->getUser();
|
||||
$this->uuid = $this->user['id'];
|
||||
}
|
||||
@ -49,6 +48,7 @@ abstract class Auth extends Controller
|
||||
{
|
||||
try {
|
||||
$user = UserService::instance();
|
||||
$this->type = input('api', 'web');
|
||||
if (empty($this->uuid)) {
|
||||
$token = input('token') ?: $this->request->header('token');
|
||||
if (empty($token)) $this->error('接口认证令牌不能为空!');
|
||||
|
Loading…
x
Reference in New Issue
Block a user