hrjy 2 years ago
parent
commit
dc8896f583
1 changed files with 8 additions and 0 deletions
  1. 8 0
      app/api/controller/user/UserController.php

+ 8 - 0
app/api/controller/user/UserController.php

@@ -6,6 +6,7 @@ use app\admin\model\diagnosis\DiagnosisApply;
 use app\http\validates\user\AddressValidate;
 use app\models\system\SystemCity;
 use app\models\user\UserVisit;
+use crmeb\services\CacheService;
 use think\db\exception\DataNotFoundException;
 use think\db\exception\DbException;
 use think\db\exception\ModelNotFoundException;
@@ -629,7 +630,14 @@ class UserController
             ['sex'],
             ['phone'],
             ['images', []],
+            ['captcha']
         ]);
+//        $verifyCode = CacheService::get('code_' . $data['phone']);
+//        if (!$verifyCode)
+//            return app('json')->fail('请先获取验证码');
+//        $verifyCode = substr($verifyCode, 0, 6);
+//        if ($verifyCode != $data['captcha'])
+//            return app('json')->fail('验证码错误');
         if (empty($data['name'])) return app('json')->fail('请填写姓名');
         if (empty($data['sex'])) return app('json')->fail('请填写性别');
         if (empty($data['phone'])) return app('json')->fail('请填写手机号');