You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.7 KiB
68 lines
1.7 KiB
<?php |
|
/** |
|
* Date: 2020/11/9 9:34 |
|
* User: chenlong <vip_chenlong@163.com> |
|
*/ |
|
|
|
namespace app\api\controller; |
|
|
|
|
|
use app\api\model\Member; |
|
use app\common\controller\Api; |
|
use app\common\ResponseJson; |
|
use app\common\SdException; |
|
use app\common\traits\api\SelfCollection; |
|
use app\middleware\Token; |
|
|
|
use sdModule\common\Sc; |
|
use think\App; |
|
|
|
/** |
|
* 公共、杂项处理控制器 |
|
* Class Common |
|
* @package app\api\controller |
|
*/ |
|
class Common extends Api |
|
{ |
|
/** |
|
* @var array 默认是不需要token的,需要的话,修改此参数或注释 |
|
*/ |
|
|
|
// public array $middleware = [Token::class=>['except'=>['download']]]; |
|
use SelfCollection; |
|
public function initialize() |
|
{ |
|
/*$token = request()->header('token'); |
|
try { |
|
$data = Sc::jwt()->tokenVerify($token); |
|
if(!isset($data['member_id'])){ |
|
throw new SdException(203); |
|
} |
|
if(!Member::getMember($data['member_id'])){ |
|
throw new SdException('会员不存在或者尚未注册'); |
|
} |
|
if(Member::getMember($data['member_id'])['status'] == 0){ |
|
throw new SdException('您被限制登录,请联系管理员'); |
|
} |
|
}catch (\Exception $exception){ |
|
throw new SdException(203); |
|
|
|
}*/ |
|
parent::initialize(); // TODO: Change the autogenerated stub |
|
|
|
} |
|
/** |
|
* 传递给前端的表信息组 |
|
* @return array|string[] |
|
*/ |
|
protected function provideTableInfo(): array |
|
{ |
|
return ['test' => '测试信息', 'user' => '用户信息']; |
|
} |
|
|
|
protected function encrypt_prefix(): string |
|
{ |
|
return 'smx'; |
|
} |
|
|
|
}
|
|
|