Skip to content

Commit

Permalink
fix: 部分情况出现注册失败
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Apr 3, 2024
1 parent bfe359c commit db6b571
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/Module/Doo.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ public static function userCreate($email, $password): User|null
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('注册失败');
Expand Down

0 comments on commit db6b571

Please sign in to comment.