zhangguidong 2 vuotta sitten
vanhempi
commit
8b508fae6d
1 muutettua tiedostoa jossa 11 lisäystä ja 111 poistoa
  1. 11 111
      application/api/controller/Login.php

+ 11 - 111
application/api/controller/Login.php

@@ -48,12 +48,11 @@ class Login extends Base
     public function Register(){
         $phone = input('phone');
         $ver_code = input('ver_code');
-        //$password = input('password');
-      //  $confirm_password = input('confirm_password');
-        $second_password = input('second_password');
-        $confirm_second_password = input('confirm_second_password');
+        $password = input('password');
+        $confirm_password = input('confirm_password');
+
         $invite_code = input('invite_code');
-        if (!$phone || !$ver_code  || !$second_password || !$confirm_second_password){
+        if (!$phone || !$ver_code  || !$password || !$confirm_password){
             $this->error('参数错误');
         }
 
@@ -67,46 +66,23 @@ class Login extends Base
             ->where('createtime','>',$time)
             ->order('id', 'DESC')
             ->find();
-       // if (!$sms || $sms['code'] != $ver_code) $this->error('短信验证码不正确!');
+        if (!$sms || $sms['code'] != $ver_code) $this->error('短信验证码不正确!');
 
         $user = Db::name('store_member')
             ->where('is_deleted',0)
             ->where('phone',$phone)
             ->find();
         if ($user) $this->error('手机号已注册');
-       // if (!preg_match('/^[0-9a-z]{6,12}$/i',$password)) $this->error('密码格式错误,请输入6-12位数字+字母');
-       // if ($password!=$confirm_password) $this->error('密码与确认密码不一致');
-        if (!preg_match('/^[0-9]{6}$/i',$second_password)) $this->error('二级密码格式错误,请输入6位纯数字');
-        if ($second_password!=$confirm_second_password) $this->error('二级密码与确认密码不一致');
-        if ($invite_code){
-            $isset = Db::name('store_member')->where('is_deleted',0)->where('invite_code',$invite_code)->find();
-            if (!$isset) $this->error('邀请码不存在');
-            $invitecode = $isset['id'];
-        }else{
-            $invitecode = 0;
-        }
-        $wallet_address = '';
-        $accountName = '';
+        if (!preg_match('/^[0-9a-z]{6,12}$/i',$password)) $this->error('密码格式错误,请输入6-12位数字+字母');
+        if ($password!=$confirm_password) $this->error('密码与确认密码不一致');
+
         $data = [
             'phone'=>$phone,
-            'pid'=>$invitecode,
-            //'password'=>md5($password),
-            'second_password'=>md5($second_password),
-            'wallet_address'=>$wallet_address,
-            'accountName'=>$accountName,
+            'password'=>md5($password),
             'reg_ip'=>request()->ip()
         ];
         $member_id = Db::name('store_member')->insertGetId($data);
         if ($member_id){
-            $code = get32Str(8);
-            $invite_img = setintivecode($code);
-            $invite_address = getintiveaddress($code);
-            Db::name('store_member')->where('id',$member_id)->update(['name'=>'收藏者'.$member_id,'invite_img'=>$invite_img,'invite_address'=>$invite_address,'invite_code'=>$code]);
-            //邀请好友送积分
-            if ($invite_code>0){
-                $invite_friends_integral = getConfigValue('invite_friends_integral');
-                memberMoneyChange($invite_friends_integral,1,$invite_code,'邀请好友',1,$member_id);
-            }
             $this->success('注册成功');
         }
         $this->error('注册失败');
@@ -126,21 +102,14 @@ class Login extends Base
      */
     public function passwordLogin()
     {
-        $type = input('type',1);   //1:验证码登录 2:密码登录
         $phone = input('phone');
 
         $password = input('password');
 
-        $ver_code = input('ver_code');
-        if ($type==1){
-            if (empty($ver_code) || empty($phone)) {
-                $this->error('参数错误');
-            }
-        }else{
+
             if (empty($password) || empty($phone)) {
                 $this->error('参数错误');
             }
-        }
 
         $member = Db::name('store_member')
             ->where('phone', $phone)
@@ -149,23 +118,9 @@ class Login extends Base
         if (!$member) $this->error('手机号未注册');
 
         //验证短信验证码
-        if ($phone!='15801075991'){
-            if ($type==1){
-                $time = time()-60;
-                $sms = Db::name('store_sms')->where(['mobile' => $phone, 'event' => 'login'])
-                    ->where('createtime','>',$time)
-                    ->order('id', 'DESC')
-                    ->find();
-                // if (!$sms || $sms['code'] != $ver_code) $this->error('短信验证码不正确!');
-            }else{
-                 if ($member['password']!=md5($password)) $this->error('密码错误');
-            }
-        }
-        $token = self::create_jwt($member['id']);
-        setMemberInfoHash($member['id']);
 
+        $token = self::create_jwt($member['id']);
         Db::name('store_member')->where('id',$member['id'])->update(['ip'=>request()->ip()]);
-        LoginLog($member['id']);
 
         $this->success('登录成功', $token);
     }
@@ -232,59 +187,4 @@ class Login extends Base
     }
 
 
-    public function test(){
-
-//        $huiju = new HuijuH5Pay();
-//        $result = $huiju->we_pay();
-//        die();
-//
-//
-//        $callback_url = 'http://'.$_SERVER['SERVER_NAME'].'/pages/mine/order-list?num=1';
-//        $huiju = new HuijuH5Pay();
-//        $notify_url = 'http://'.$_SERVER['SERVER_NAME'].'/index.php/api/Pay/ylOrderNotify';//回调地址
-//        $huiju->ylh5Pay(get_order_sn(),$callback_url,$notify_url,"测试藏品","0.01",'100000',1);
-
-        $huiju = new HuijuKjPay();
-       // $huiju->sms();
-       // $huiju->signing();
-         $huiju->paySms();
-         $huiju->kuaijiePay();
-        die;
-
-
-
-
-        require_once env('root_path').'application/common/library/lib/YopRequest.php';
-        require_once env('root_path').'application/common/library/lib/YopClient3.php';
-        require_once env('root_path').'application/common/library/lib/YopRsaClient.php';
-        $private_key ="MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCSBUBO99o0ZCGp8/6qbaSW2MIeHKg/4RZEIexS11rW5wxFH9arHM16yZXObtm1qO1xNnRyofBkKvcOes63yNGqiulDjJbx2gxXzQdq6g0ckO06YZsb6v4AmkCLwu/kFPYTd2zu3nM6VCBsppkjXe2kcdgeKH55PSqTLcqe4TCeCQxxTjmixX/qFdKva7uJxXbdNjE+GERMTPsn9FBGjrv2/6RCz62eZljRcQf2zY9aooXnYaYOOkeYxJaFu4M8k1kEfL/A2ftDGa+9zyWUUp/PskIcSUCLtdd+yR1ZvNldBW7iaeTuZ4YQXg6N3BqFBacBmkHztpqbrg1+C46Hp9C5AgMBAAECggEAHxpGPevWSzWO5BwIQTYUilsGUhKpld20d/O/2k9r1n2lY+3ptE3wyLg6lBuRfPvMA8LlH+u1gCiUsj1fXc9FNa3cDNrb5g0bdvJBo7jR7SVDmp1ixBoUW31/xSVTIsKCPdhA2EqCwchclbgQw3NE5LOpJJdchSeNs4bb82alC+wwDaYnrag/OuehknazOQWqWQVaPI9zJ+eXPNW3etWte1OLDyVoNiSrAdr/BWnBxSxcoANuzypkKN/Sw5W3vgkIHyylReiOLP2JLDNpnDlwgNIaxYOF7p0VGLC1bAqZTjuR4nMKZhohC4FtNC1cy9ZV2c2KV3bD8OXoMPIQB1a8OQKBgQDJnVxK2Mwk/2jitP7mA6JpBFeioJLRzj4gKK56M4InYaRRVZj6UWJd5Jt0uEs6XMlus8T24cfSoglCnXIvTMx8okTbusxn72Ff+/+f0GRLI/VO/cyhSWFl+0P3XTCT+zUVI3+kWvZQ6Tj7l5BWubqLObBdrNDhpbYhQptnm+KHJQKBgQC5aMwHmtE5Cs6+z2zGkIvVw4dOQcvo9E+gGCsjbSdeFvcrOpg/NNQ0dmu54F8CF6z9VkoitL8NTI63V4LqLnZ9BK+K/0L8UMzbbhCqT9+JTrjNraby77akxldKTUZZHiC1edWT/Ll8t6xT6oVw02yZz8Flpc7DnNXuJGGxQIlpBQKBgHinh3fzThhGEUq67mBQhH08cAWO+s48EsnEDsZq1NUkheV2yFnlImz2RmIPeFWw+YsaYiEs9RyEg+4tswvDdgyQP40PuQvqIegDMvM9Dwg4uLFRCYjsFTGmsQHz7wJgL2A7IkQFe6roJ4XJKkP8Wjq/h2BH76laNiipZ78VdvdRAoGAKqgnuOAvnrYT1uaWGiELawTvTlvo9BGxeB3XXvEwC3+xIir6+B/JasCMDFnIwgx8alS9/boj8oVYmGnz3rkN3bmEQbB00uQsHZf3EZgKz+Zisj9vl5j7JnHTh2677qj10YrUTpXofv8rEKt2Q/0AkWqxDhfVuD+PIJkSONumQZkCgYACVSnvt+kizEIwdshvGzAkzZaMBR6Xf1d//cuIWzU1bO7pkCQogq9MXv9hCZx2N1B51VSvwazJ6B029uzgYzr0iTeZBfB5ntb53/vEycLMhB9r9Bc+0x7bxrQZeWNwLlQFxhDeSO9le0ETjfGPt/nS2QbFL7bNHwRGE+AzxwH0aA==";
-        $request = new \YopRequest("app_10086863938", $private_key);
-
-        $request->addParam('requestNo',get_order_sn());
-        $request->addParam('parentMerchantNo','10086863938');
-        $request->addParam('merchantNo','10086863938');
-        $request->addParam('name','宋星伟');
-        $request->addParam('cardNo','371324199210037710');
-        $request->addParam('cardType','ID');
-        $request->addParam('returnUrl','https://'.$_SERVER['SERVER_NAME'].'/web/h5/pages/mine/order-list?num=1');
-        $request->addParam('notifyUrl','https://'.$_SERVER['SERVER_NAME'].'/api/Pay/re');
-
-        $response = \YopRsaClient::post("/rest/v1.0/auth/face-auth", $request);
-        dump(json_decode(json_encode($response,true),true));
-        die;
-
-
-
-
-
-//        require_once env('root_path').'application/common/library/lib/YopRequest.php';
-//        require_once env('root_path').'application/common/library/lib/YopClient3.php';
-//        require_once env('root_path').'application/common/library/lib/YopRsaClient.php';
-//        $private_key ="MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCSBUBO99o0ZCGp8/6qbaSW2MIeHKg/4RZEIexS11rW5wxFH9arHM16yZXObtm1qO1xNnRyofBkKvcOes63yNGqiulDjJbx2gxXzQdq6g0ckO06YZsb6v4AmkCLwu/kFPYTd2zu3nM6VCBsppkjXe2kcdgeKH55PSqTLcqe4TCeCQxxTjmixX/qFdKva7uJxXbdNjE+GERMTPsn9FBGjrv2/6RCz62eZljRcQf2zY9aooXnYaYOOkeYxJaFu4M8k1kEfL/A2ftDGa+9zyWUUp/PskIcSUCLtdd+yR1ZvNldBW7iaeTuZ4YQXg6N3BqFBacBmkHztpqbrg1+C46Hp9C5AgMBAAECggEAHxpGPevWSzWO5BwIQTYUilsGUhKpld20d/O/2k9r1n2lY+3ptE3wyLg6lBuRfPvMA8LlH+u1gCiUsj1fXc9FNa3cDNrb5g0bdvJBo7jR7SVDmp1ixBoUW31/xSVTIsKCPdhA2EqCwchclbgQw3NE5LOpJJdchSeNs4bb82alC+wwDaYnrag/OuehknazOQWqWQVaPI9zJ+eXPNW3etWte1OLDyVoNiSrAdr/BWnBxSxcoANuzypkKN/Sw5W3vgkIHyylReiOLP2JLDNpnDlwgNIaxYOF7p0VGLC1bAqZTjuR4nMKZhohC4FtNC1cy9ZV2c2KV3bD8OXoMPIQB1a8OQKBgQDJnVxK2Mwk/2jitP7mA6JpBFeioJLRzj4gKK56M4InYaRRVZj6UWJd5Jt0uEs6XMlus8T24cfSoglCnXIvTMx8okTbusxn72Ff+/+f0GRLI/VO/cyhSWFl+0P3XTCT+zUVI3+kWvZQ6Tj7l5BWubqLObBdrNDhpbYhQptnm+KHJQKBgQC5aMwHmtE5Cs6+z2zGkIvVw4dOQcvo9E+gGCsjbSdeFvcrOpg/NNQ0dmu54F8CF6z9VkoitL8NTI63V4LqLnZ9BK+K/0L8UMzbbhCqT9+JTrjNraby77akxldKTUZZHiC1edWT/Ll8t6xT6oVw02yZz8Flpc7DnNXuJGGxQIlpBQKBgHinh3fzThhGEUq67mBQhH08cAWO+s48EsnEDsZq1NUkheV2yFnlImz2RmIPeFWw+YsaYiEs9RyEg+4tswvDdgyQP40PuQvqIegDMvM9Dwg4uLFRCYjsFTGmsQHz7wJgL2A7IkQFe6roJ4XJKkP8Wjq/h2BH76laNiipZ78VdvdRAoGAKqgnuOAvnrYT1uaWGiELawTvTlvo9BGxeB3XXvEwC3+xIir6+B/JasCMDFnIwgx8alS9/boj8oVYmGnz3rkN3bmEQbB00uQsHZf3EZgKz+Zisj9vl5j7JnHTh2677qj10YrUTpXofv8rEKt2Q/0AkWqxDhfVuD+PIJkSONumQZkCgYACVSnvt+kizEIwdshvGzAkzZaMBR6Xf1d//cuIWzU1bO7pkCQogq9MXv9hCZx2N1B51VSvwazJ6B029uzgYzr0iTeZBfB5ntb53/vEycLMhB9r9Bc+0x7bxrQZeWNwLlQFxhDeSO9le0ETjfGPt/nS2QbFL7bNHwRGE+AzxwH0aA==";
-//        $request = new \YopRequest("app_10086863938", $private_key);
-//        $request->addFile("merQual", "C:\Users\xk\Pictures\΢�Ž�ͼ_20220316150041.png");
-//        $response = \YopRsaClient::upload("/yos/v1.0/sys/merchant/qual/upload", $request);
-//        dump($response);
-    }
-
 }