From a6460ecaf069444fe743982dda5492659417c9ed Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Sat, 6 Jul 2024 16:01:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=9C=B0=E5=9D=80=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/user/UserLogic.php | 7 ++++++- app/api/controller/store/StoreController.php | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/admin/logic/user/UserLogic.php b/app/admin/logic/user/UserLogic.php index 8b2f6729..e295d425 100644 --- a/app/admin/logic/user/UserLogic.php +++ b/app/admin/logic/user/UserLogic.php @@ -76,7 +76,7 @@ class UserLogic extends BaseLogic } } - public static function StoreAdd(array $params) + public static function checkAddress(array $params) { $user_ship=$params['user_ship']??0; if($user_ship==2){ @@ -106,6 +106,11 @@ class UserLogic extends BaseLogic } } } + return true; + } + public static function StoreAdd(array $params) + { + self::checkAddress($params); $passwordSalt = Config::get('project.unique_identification'); $password = create_password(123456, $passwordSalt); $defaultAvatar = config('project.default_image.admin_avatar'); diff --git a/app/api/controller/store/StoreController.php b/app/api/controller/store/StoreController.php index 5872c05f..a543ebb9 100644 --- a/app/api/controller/store/StoreController.php +++ b/app/api/controller/store/StoreController.php @@ -89,6 +89,10 @@ class StoreController extends BaseApiController return $this->fail(UserUserLogic::getError()); } }else{ + UserUserLogic::checkAddress($params); + if(UserUserLogic::hasError()){ + return $this->fail(UserUserLogic::getError()); + } $find['real_name']=$params['real_name']; $find['label_id']=$params['label_id']??0; $find->save();