webman迁移

This commit is contained in:
2026-03-18 11:22:12 +08:00
parent dab3b3148f
commit ea77c7b3a1
623 changed files with 38163 additions and 106 deletions

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace app\admin\controller;
use ba\ClickCaptcha;
use ba\Random;
use app\common\facade\Token;
use app\admin\model\AdminLog;
use app\common\controller\Backend;
@@ -107,8 +108,14 @@ class Index extends Backend
$res = $this->auth->login($username, $password, (bool) $keep);
if ($res === true) {
$userInfo = $this->auth->getInfo();
// 兜底:若 getInfo 未返回 token在控制器层生成并入库
if (empty($userInfo['token']) && $this->auth->isLogin()) {
$userInfo['token'] = Random::uuid();
Token::set($userInfo['token'], \app\admin\library\Auth::TOKEN_TYPE, $this->auth->id, (int) config('buildadmin.admin_token_keep_time', 86400 * 3));
}
return $this->success(__('Login succeeded!'), [
'userInfo' => $this->auth->getInfo()
'userInfo' => $userInfo
]);
}
$msg = $this->auth->getError();