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

+ 5 - 5
app/controller/User.php

@@ -30,16 +30,16 @@ class User extends BaseController
 	 */
     public function register()
     {
-        $post =$this->request->only(["nickname"=>'',"password"=>"","mobile"=>"","source"=>"register"],"post","trim");
+        $post =$this->request->only(["username"=>'',"password"=>"","mobile"=>"","source"=>"register"],"post","trim");
 
         $validate=Validate::rule([
-    		'nickname|真实姓名' => 'require|max:255',
+    		'username|账户名称' => '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['mobile']])->find();
+        $uiq = Db::table("sys_account")->where(["username"=>$post['username']])->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['mobile'],
+            	'username'=>$post['username'],
                 "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['nickname'],
+                    "nickname"=>$post['username'],
                     "mobile"=>$post['mobile'],
                     "email"=>"",
                     "portrait"=>"",