框架升级及修复升级后的bug

This commit is contained in:
Dev
2026-10-16 18:13:09 +08:00
parent dafb0c96c0
commit 2d342bcbd7
537 changed files with 49836 additions and 40933 deletions
+8 -2
View File
@@ -34,8 +34,14 @@ class Token extends Api
$token = $this->auth->getToken();
\app\common\library\Token::delete($token);
//创建新Token
$token = Random::uuid();
\app\common\library\Token::set($token, $this->auth->id, 2592000);
$attempts = 0;
do {
$token = Random::uuid();
$result = \app\common\library\Token::set($token, $this->auth->id, 2592000);
} while (!$result && ++$attempts < 5);
if (!$result) {
$this->error('Failed to generate token');
}
$tokenInfo = \app\common\library\Token::get($token);
$this->success('', ['token' => $tokenInfo['token'], 'expires_in' => $tokenInfo['expires_in']]);
}