更新解析token解析

This commit is contained in:
yaooo 2023-11-13 09:47:16 +08:00
parent 6264b24a9c
commit 2c7dcd6fe1
2 changed files with 13 additions and 1 deletions

View File

@ -55,7 +55,7 @@ class LoginController extends BaseApiController
// 验证token
public function verify(): Json
{
$params = (new TokenValidate())->post()->goCheck();
$params = (new TokenValidate())->post()->goCheck('JwtToken');
$result = LoginLogic::verifyJwtToken($params);
if (false === $result) {
return $this->fail(LoginLogic::getError());

View File

@ -15,4 +15,16 @@ class TokenValidate extends BaseValidate
'token.require' => '缺少必要参数token',
'uid.require' => '缺少必要参数uid',
];
//UserToken验证
public function sceneUserToken()
{
return $this->only(['uid', 'token']);
}
//JwtToken验证
public function sceneJwtToken()
{
return $this->only(['token']);
}
}