更新解析token解析
This commit is contained in:
parent
6264b24a9c
commit
2c7dcd6fe1
|
@ -55,7 +55,7 @@ class LoginController extends BaseApiController
|
||||||
// 验证token
|
// 验证token
|
||||||
public function verify(): Json
|
public function verify(): Json
|
||||||
{
|
{
|
||||||
$params = (new TokenValidate())->post()->goCheck();
|
$params = (new TokenValidate())->post()->goCheck('JwtToken');
|
||||||
$result = LoginLogic::verifyJwtToken($params);
|
$result = LoginLogic::verifyJwtToken($params);
|
||||||
if (false === $result) {
|
if (false === $result) {
|
||||||
return $this->fail(LoginLogic::getError());
|
return $this->fail(LoginLogic::getError());
|
||||||
|
|
|
@ -15,4 +15,16 @@ class TokenValidate extends BaseValidate
|
||||||
'token.require' => '缺少必要参数token',
|
'token.require' => '缺少必要参数token',
|
||||||
'uid.require' => '缺少必要参数uid',
|
'uid.require' => '缺少必要参数uid',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
//UserToken验证
|
||||||
|
public function sceneUserToken()
|
||||||
|
{
|
||||||
|
return $this->only(['uid', 'token']);
|
||||||
|
}
|
||||||
|
|
||||||
|
//JwtToken验证
|
||||||
|
public function sceneJwtToken()
|
||||||
|
{
|
||||||
|
return $this->only(['token']);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue