refactor: 修复登录接口
This commit is contained in:
@@ -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']]);
|
||||
|
||||
Reference in New Issue
Block a user