From 883f0f1cfa1e773a5fff9f7686ddc26e2938a3e8 Mon Sep 17 00:00:00 2001 From: liyinglin Date: Tue, 21 Mar 2023 10:43:39 +0800 Subject: [PATCH] 1 --- app/Http/Controllers/Mobile/UserController.php | 1 - app/Models/User.php | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Mobile/UserController.php b/app/Http/Controllers/Mobile/UserController.php index e7ac74e..127d052 100644 --- a/app/Http/Controllers/Mobile/UserController.php +++ b/app/Http/Controllers/Mobile/UserController.php @@ -41,7 +41,6 @@ class UserController extends CommonController $appSecret = \config('app.wechat_appsecret'); $url = "https://api.weixin.qq.com/sns/jscode2session?appid=" . $appid . "&secret=" . $appSecret . "&js_code={$all['code']}&grant_type=authorization_code"; $userInfo = json_decode(file_get_contents($url), true); - dd($userInfo); if (!isset($userInfo['openid'])) { return $this->fail([ResponseCode::ERROR_BUSINESS, 'code异常']); } diff --git a/app/Models/User.php b/app/Models/User.php index 8996368..7e51efd 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -12,6 +12,7 @@ class User extends Authenticatable { use HasApiTokens, HasFactory, Notifiable; + protected $guarded = ['id']; /** * The attributes that are mass assignable. *