refactor: 修复登录接口

This commit is contained in:
2025-01-03 18:11:33 +08:00
parent 22d1604974
commit 00efb53214

View File

@@ -68,16 +68,14 @@ class Login
} catch (\Throwable $th) {
$msg = $th->getMessage();
return error('登录失败!');
} finally {
}
// 记录登录日志
UserLoginLogModel::create([
'user_id' => $user['id'],
'ip' => ip2long(request()->ip()),
'user_agent' => request()->header('user-agent'),
'message' => $msg,
'status' => !$msg ? 1 : -1,
]);
}
// 生成 jwt token
$token = JWTAuth::builder(['uid' => $user['id']]);