fix: 部分情况出现注册失败

This commit is contained in:
kuaifan 2024-04-03 10:14:41 +08:00
parent bfe359c440
commit db6b571cfb

View File

@ -228,6 +228,14 @@ class Doo
if (Base::isError($data)) {
throw new ApiException($data['msg'] ?: '注册失败');
}
if (\DB::transactionLevel() > 0) {
try {
\DB::commit();
\DB::beginTransaction();
} catch (\Throwable) {
// do nothing
}
}
$user = User::whereEmail($email)->first();
if (empty($user)) {
throw new ApiException('注册失败');