From b05ef660431b55662ad0d829370e118b4f5400f2 Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Sun, 24 Mar 2024 13:33:04 +0800 Subject: [PATCH] 1 --- app/api/controller/Captcha.php | 5 +++-- app/api/controller/Controller.php | 20 ++++++++++---------- app/store/controller/Order.php | 6 +----- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/app/api/controller/Captcha.php b/app/api/controller/Captcha.php index 72acd689..e4947cb0 100644 --- a/app/api/controller/Captcha.php +++ b/app/api/controller/Captcha.php @@ -12,9 +12,9 @@ declare (strict_types=1); namespace app\api\controller; -use think\response\Json; use app\api\service\passport\{Captcha as CaptchaService, SmsCaptcha as SmsCaptchaService}; use cores\exception\BaseException; +use think\response\Json; /** * 验证码管理 @@ -40,8 +40,9 @@ class Captcha extends Controller */ public function sendSmsCaptcha(): Json { + $data['mobile'] = $this->request->post('mobile'); $SmsCaptchaService = new SmsCaptchaService; - if ($SmsCaptchaService->handle($this->postForm())) { + if ($SmsCaptchaService->handle($data)) { return $this->renderSuccess('发送成功,请注意查收'); } return $this->renderError($SmsCaptchaService->getError() ?: '短信发送失败'); diff --git a/app/api/controller/Controller.php b/app/api/controller/Controller.php index 9cd340f1..67127e6a 100644 --- a/app/api/controller/Controller.php +++ b/app/api/controller/Controller.php @@ -12,14 +12,14 @@ declare (strict_types=1); namespace app\api\controller; -use cores\BaseController; -use app\api\model\User as UserModel; use app\api\model\Store as StoreModel; use app\api\model\store\Module as StoreModuleModel; +use app\api\model\User as UserModel; use app\api\service\User as UserService; +use cores\BaseController; use cores\exception\BaseException; -use think\db\exception\DbException; use think\db\exception\DataNotFoundException; +use think\db\exception\DbException; use think\db\exception\ModelNotFoundException; /** @@ -47,13 +47,13 @@ class Controller extends BaseController $this->checkStore(); // 验证当前客户端状态 $this->checkClient(); - $user = $this->getLoginUser(); - if ($user) { - if ($user->user_type == 0 || $user->status == 0) { - throwError('很抱歉,您没有权限进入系统'); - } - } - + //$user = $this->getLoginUser(); +// if ($user) { +// if ($user->user_type == 0 || $user->status == 0) { +// throwError('很抱歉,您没有权限进入系统'); +// } +// } + } /** diff --git a/app/store/controller/Order.php b/app/store/controller/Order.php index b2838094..ebfad295 100644 --- a/app/store/controller/Order.php +++ b/app/store/controller/Order.php @@ -64,11 +64,7 @@ class Order extends Controller $list['data'] = $data; return $this->renderSuccess(compact('dataType', 'list')); } - - private function getText() - { - - } + /** * 订单详情