This commit is contained in:
2021-07-13 17:15:07 +08:00
parent 250b5b0928
commit 3009c3fcf0
3 changed files with 16 additions and 18 deletions
+4 -2
View File
@@ -76,6 +76,7 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
/**
* @throws ConfigException
* @throws Exception
*/
public function init()
{
@@ -235,9 +236,10 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
if (!openssl_public_decrypt(base64_decode($headers['refresh']), $data, $this->public)) {
throw new AuthException('信息解码失败.');
}
$data = Json::decode($data, true);
if (!isset($headers['token']) || $data['token'] != $headers['token']) {
throw new AuthException('信息解码失败.');
}
return (int)$data['user'];
}