2023-09-18 09:11:13 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace app\common\validate\login;
|
|
|
|
|
|
|
|
use app\common\validate\BaseValidate;
|
|
|
|
|
|
|
|
class TokenValidate extends BaseValidate
|
|
|
|
{
|
|
|
|
protected $rule = [
|
|
|
|
'token' => 'require',
|
2023-09-19 10:39:28 +08:00
|
|
|
'uid' => 'require',
|
2023-09-18 09:11:13 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
protected $message = [
|
2023-09-19 10:39:28 +08:00
|
|
|
'token.require' => '缺少必要参数token',
|
|
|
|
'uid.require' => '缺少必要参数uid',
|
2023-09-18 09:11:13 +08:00
|
|
|
];
|
2023-11-13 09:47:16 +08:00
|
|
|
|
|
|
|
//UserToken验证
|
|
|
|
public function sceneUserToken()
|
|
|
|
{
|
|
|
|
return $this->only(['uid', 'token']);
|
|
|
|
}
|
|
|
|
|
|
|
|
//JwtToken验证
|
|
|
|
public function sceneJwtToken()
|
|
|
|
{
|
|
|
|
return $this->only(['token']);
|
|
|
|
}
|
2023-09-18 09:11:13 +08:00
|
|
|
}
|