Bläddra i källkod

账户注册时优化字段

wufeng 2 år sedan
förälder
incheckning
fcc4b94b46
1 ändrade filer med 6 tillägg och 6 borttagningar
  1. 6 6
      app/controller/User.php

+ 6 - 6
app/controller/User.php

@@ -30,16 +30,16 @@ class User extends BaseController
 	 */
     public function register()
     {
-        $post =$this->request->only(["username"=>'',"password"=>"","mobile"=>"","source"=>"register"],"post","trim");
+        $post =$this->request->only(["nickname"=>'',"password"=>"","mobile"=>"","source"=>"register"],"post","trim");
 
         $validate=Validate::rule([
-    		'username|账户名称' => 'require|max:255',
+    		'nickname|真实姓名' => 'require|max:255',
     		'password|密码' => 'require|min:6|max:200',
     		'mobile|手机号' => 'require|number|length:11|mobile',
             ]);
     	if($validate->check($post)==false) return json_show(1004,$validate->getError());
         $source = isset($post['source']) ? trim($post['source']):"";
-        $uiq = Db::table("sys_account")->where(["username"=>$post['username']])->find();
+        $uiq = Db::table("sys_account")->where(["username"=>$post['mobile']])->find();
         if($uiq){
             return json_show(1002,"账户名已存在!");
         }
@@ -52,7 +52,7 @@ class User extends BaseController
             $salt =makeSalt();
             $password = sha1($post['password'].$salt);
             $data = [
-            	'username'=>$post['username'],
+            	'username'=>$post['mobile'],
                 "password"=>$password,
                 "salt"=>$salt,
                 "mobile"=>$post['mobile'],
@@ -64,7 +64,7 @@ class User extends BaseController
             $reuslt = Db::table('sys_account')->insert($data,true);
             if($reuslt){
                 $data=[
-                    "nickname"=>$post['username'],
+                    "nickname"=>$post['nickname'],
                     "mobile"=>$post['mobile'],
                     "email"=>"",
                     "portrait"=>"",
@@ -168,7 +168,7 @@ class User extends BaseController
         	->where(["a.status"=>1,"a.is_del"=>0,"a.plat_code"=>$post['plat_code'],"a.account_id"=>$acc['id']])
         	->findOrEmpty();
         	if(empty($platinfo)){
-        		 return json_show(1003,'该系统账号开通登录');
+        		 return json_show(1003,'该系统账号开通登录');
         	}
         }
 		$user =Db::name("account")->alias("a")