瀏覽代碼

修复个人注册提示错误

sugangqiang 1 年之前
父節點
當前提交
a7cceb96f7
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/common/controller/Auth.php

+ 2 - 2
app/common/controller/Auth.php

@@ -654,7 +654,7 @@ class Auth extends BaseController {
         ];
         ];
         $verificationCode = \StrUtil::getRequestDecodeParam($this->request, 'verificationCode');
         $verificationCode = \StrUtil::getRequestDecodeParam($this->request, 'verificationCode');
         try {
         try {
-            validate(Person::class)->batch(true)->scene('add')->check($data);
+            validate(Person::class)->batch(false)->scene('add')->check($data);
             //检验验证码
             //检验验证码
             $codeResult = MessageRecord::where('smsType', 1)->where('phone', $data['phone'])->order('createTime', 'desc')->find();
             $codeResult = MessageRecord::where('smsType', 1)->where('phone', $data['phone'])->order('createTime', 'desc')->find();
 
 
@@ -696,7 +696,7 @@ class Auth extends BaseController {
             $response_object->msg = "注册成功";
             $response_object->msg = "注册成功";
             return json($response_object);
             return json($response_object);
         } catch (ValidateException $e) {
         } catch (ValidateException $e) {
-            $response_object->msg = $e->getError();
+            $response_object->msg = $e->getMessage();
             return json($response_object);
             return json($response_object);
         } catch (\think\db\exception\DbException $e) {
         } catch (\think\db\exception\DbException $e) {
             $response_object->msg = $e->getMessage();
             $response_object->msg = $e->getMessage();