From c465ddd696dfa954ef0b5e2a35379bd9fc3e1299 Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Tue, 13 Jan 2026 15:39:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/controller/UserController.php | 7 +++++++ app/common/logic/AuthLogic.php | 1 + app/common/model/User.php | 2 +- app/common/utils/pdf/template/usedCar.stub | 19 ++++++++++++++----- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/app/common/controller/UserController.php b/app/common/controller/UserController.php index b489739..99c1fd7 100644 --- a/app/common/controller/UserController.php +++ b/app/common/controller/UserController.php @@ -2,6 +2,7 @@ namespace app\common\controller; use app\common\controller\BaseController; +use app\common\service\OssService; use app\common\traits\crud\CrudControllerTrait; use app\common\service\UserService; use support\Request; @@ -85,6 +86,12 @@ class UserController extends BaseController $data['updated_at'] = date('Y-m-d H:i:s', $data['updated_at']); unset($data['union_id']); unset($data['app_id']); + + $ossservice = new OssService(); + $data['user']['avatar_pull'] = $data['user']['avatar']; + if(!str_contains($data['user']['avatar'], 'http') && !empty($data['user']['avatar'])){ + $data['user']['avatar_pull'] = $ossservice->generatePrivateUrl($data['user']['avatar']); + } return $data; } } \ No newline at end of file diff --git a/app/common/logic/AuthLogic.php b/app/common/logic/AuthLogic.php index f4510f1..c6bab0e 100644 --- a/app/common/logic/AuthLogic.php +++ b/app/common/logic/AuthLogic.php @@ -218,6 +218,7 @@ class AuthLogic } + Log::info('userInfo:' ,[$userInfo]); User::firstOrCreate(['union_id'=>$userInfo['data']['union_id']],[ 'union_id'=>$userInfo['data']['union_id'], 'name'=>$userInfo['data']['name'], diff --git a/app/common/model/User.php b/app/common/model/User.php index 50ff43a..0110f68 100644 --- a/app/common/model/User.php +++ b/app/common/model/User.php @@ -40,7 +40,7 @@ class User extends Model /** * 允许自动填充模型字段 */ - protected $fillable = ['id', 'union_id', 'app_id', 'name', 'phone', 'email', 'whatsapp', 'social', 'social_code']; + protected $fillable = ['id', 'union_id', 'app_id', 'name', 'avatar', 'phone', 'email', 'whatsapp', 'social', 'social_code']; /** * 不允许自动填充模型字段 diff --git a/app/common/utils/pdf/template/usedCar.stub b/app/common/utils/pdf/template/usedCar.stub index 398986c..fb1dc22 100644 --- a/app/common/utils/pdf/template/usedCar.stub +++ b/app/common/utils/pdf/template/usedCar.stub @@ -110,11 +110,20 @@
|
+ |
+
+
+