mirror of https://gitee.com/karson/fastadmin.git
fix(common): getEncryptedToken 的 php8 兼容修复
parent
c8404c7096
commit
198604c584
|
|
@ -76,6 +76,7 @@ abstract class Driver
|
|||
protected function getEncryptedToken($token)
|
||||
{
|
||||
$config = \think\Config::get('token');
|
||||
$token = $token ?? ''; // 为兼容 php8
|
||||
return hash_hmac($config['hashalgo'], $token, $config['key']);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ class Redis extends Driver
|
|||
protected function getEncryptedToken($token)
|
||||
{
|
||||
$config = \think\Config::get('token');
|
||||
$token = $token ?? ''; // 为兼容 php8
|
||||
return $this->options['tokenprefix'] . hash_hmac($config['hashalgo'], $token, $config['key']);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue