Ver Fonte

注册和个人资料

lizhen_gitee há 1 ano atrás
pai
commit
4514f004a4

+ 5 - 2
application/api/controller/User.php

@@ -131,7 +131,9 @@ class User extends Api
         $email        = input('email');
         $emailcaptcha = input('emailcaptcha');
 
-        if (!$firstname || !$lastname || !$mobile || !$captcha  || !$email  || !$emailcaptcha ) {
+        $password     = input('password');
+
+        if (!$firstname || !$lastname || !$mobile || !$captcha  || !$email  || !$emailcaptcha || !$password) {
             $this->error(__('Invalid parameters'));
         }
 
@@ -142,7 +144,7 @@ class User extends Api
             $this->error(__('Mobile is incorrect'));
         }*/
 
-        $password        = input('password');
+
 
         $fullmobile = $countrycode.$mobile;
         $ret = Sms::check($fullmobile, $captcha, 'register');
@@ -163,6 +165,7 @@ class User extends Api
             'age'          => input('age',''),
             'weight'       => input('weight',''),
             'address'      => input('address',''),
+            'knowus'       => input('knowus','')
         ];
         $ret = $this->auth->register('', $password, $email, $fullmobile, $extend);
         if ($ret) {

+ 1 - 1
application/common/library/Auth.php

@@ -26,7 +26,7 @@ class Auth
     //默认配置
     protected $config = [];
     protected $options = [];
-    protected $allowFields = ['id', 'username', 'mobile', 'avatar', 'email', 'firstname', 'lastname'];
+    protected $allowFields = ['id', 'username', 'mobile', 'simplemobile', 'avatar', 'email', 'firstname', 'lastname', 'height','age','weight','address','notice_type','whatsapp'];
 
     public function __construct($options = [])
     {