From 75a42c98467e9307fbba62478f4c77876da227f1 Mon Sep 17 00:00:00 2001 From: panliang <1163816051@qq.com> Date: Mon, 16 Oct 2023 15:48:11 +0800 Subject: [PATCH] user_socialte --- app/Admin/Controllers/AuthController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Admin/Controllers/AuthController.php b/app/Admin/Controllers/AuthController.php index 412362a..4b6b1ad 100644 --- a/app/Admin/Controllers/AuthController.php +++ b/app/Admin/Controllers/AuthController.php @@ -49,6 +49,10 @@ class AuthController extends AdminAuthController $openid = $request->input('openid'); $open_type = $request->input('open_type'); if ($openid && $open_type) { + UserSocialite::where([ + 'type' => SocialiteType::from($open_type), + 'user_type' => $user->getMorphClass(), + ])->update(['user_id' => null]); UserSocialite::updateOrCreate([ 'type' => SocialiteType::from($open_type), 'user_type' => $user->getMorphClass(),