Ver Fonte

删除垃圾代码,一键登录配置

lizhen_gitee há 8 meses atrás
pai
commit
9b616d7d77
2 ficheiros alterados com 5 adições e 153 exclusões
  1. 1 149
      application/api/controller/User.php
  2. 4 4
      application/config.php

+ 1 - 149
application/api/controller/User.php

@@ -235,155 +235,7 @@ class User extends Api
         }
     }
 
-    /**
-     * 注册会员
-     *
-     * @ApiMethod (POST)
-     * @param string $username 用户名
-     * @param string $password 密码
-     * @param string $email    邮箱
-     * @param string $mobile   手机号
-     * @param string $code     验证码
-     */
-    /*public function register()
-    {
-        $username = $this->request->post('username');
-        $password = $this->request->post('password');
-        $email = $this->request->post('email');
-        $mobile = $this->request->post('mobile');
-        $code = $this->request->post('code');
-        if (!$username || !$password) {
-            $this->error(__('Invalid parameters'));
-        }
-        if ($email && !Validate::is($email, "email")) {
-            $this->error(__('Email is incorrect'));
-        }
-        if ($mobile && !Validate::regex($mobile, "^1\d{10}$")) {
-            $this->error(__('Mobile is incorrect'));
-        }
-        $ret = Sms::check($mobile, $code, 'register');
-        if (!$ret) {
-            $this->error(__('Captcha is incorrect'));
-        }
-        $ret = $this->auth->register($username, $password, $email, $mobile, []);
-        if ($ret) {
-            $data = $this->userInfo('return');
-            $this->success(__('Sign up successful'), $data);
-        } else {
-            $this->error($this->auth->getError());
-        }
-    }*/
-
-    //微信登录
-    public function wechatlogin(){
-//        $nickname = input('nickname','');
-//        $avatar = input('avatar','');
-//        $gender = input('gender',1);
-        $wechat_openid = input('wechat_openid','');
-
-        if (!$wechat_openid) {
-            $this->error(__('Invalid parameters'));
-        }
-//        if($gender != 1){
-//            $gender = 0;
-//        }
-
-        $user = \app\common\model\User::getByOpenid($wechat_openid);
-        if ($user) {
-            if (!in_array($user->status,[1,2])) {
-                $this->error(__('Account is locked'));
-            }
-            if ($user->frozentime > time()) {
-                $this->error('您的账号已被封禁至' . date('Y-m-d H:i'));
-            }
-            //如果已经有账号则直接登录
-            $ret = $this->auth->direct($user->id);
-
-            //非首次注册男性用户每次打开app,系统自动推送女性(公会)打招呼消息3人次
-            /*if($user->gender == 1 && $user->gh_id == 0){
-                $this->firstopen_send($user->id);
-            }*/
-        } else {
-//            $this->success('选择性别', ['code' => 5]);
-
-//            if (!$nickname || !$avatar) {
-//                $this->error(__('Invalid parameters'));
-//            }
-
-            $reg_data = [
-//                'nickname'=>$nickname,
-//                'avatar'=>$avatar,
-//                'gender'=>$gender,
-                'register_from' => input('register_from',''),
-                'gender' => -1
-            ];
-            $ret = $this->auth->openid_register($wechat_openid,$reg_data);
-            //亿米
-            /*if(input('register_from','') == 'xiaomi'){
-                $this->yimi_advert();
-            }*/
-        }
-        if ($ret) {
-            $data = $this->userInfo('return');
-            $this->success(__('Logged in successful'), $data);
-        } else {
-            $this->error($this->auth->getError());
-        }
-    }
-
-    //微信注册
-    public function wechatregiter(){
-//        $nickname = input('nickname','');
-//        $avatar = input('avatar','');
-//        $gender = input('gender',1);
-        $wechat_openid = input('wechat_openid','');
-        $gender = input('gender', -1, 'intval'); //性别:1=男,0=女
-
-        if (!$wechat_openid) {
-            $this->error(__('Invalid parameters'));
-        }
-        if (!in_array($gender, [1, 0])) {
-            $this->error('性别错误');
-        }
-
-        $user = \app\common\model\User::getByOpenid($wechat_openid);
-        if ($user) {
-            $this->error('账号已经存在,请直接登录');
-
-            if (!in_array($user->status,[1,2])) {
-                $this->error(__('Account is locked'));
-            }
-            //如果已经有账号则直接登录
-            $ret = $this->auth->direct($user->id);
-
-            //非首次注册男性用户每次打开app,系统自动推送女性(公会)打招呼消息3人次
-            /*if($user->gender == 1 && $user->gh_id == 0){
-                $this->firstopen_send($user->id);
-            }*/
-        } else {
-//            if (!$nickname || !$avatar) {
-//                $this->error(__('Invalid parameters'));
-//            }
-
-            $reg_data = [
-//                'nickname'=>$nickname,
-//                'avatar'=>$avatar,
-                'gender'=>$gender,
-                'register_from' => input('register_from',''),
-            ];
-            $ret = $this->auth->openid_register($wechat_openid,$reg_data);
-            //亿米
-            /*if(input('register_from','') == 'xiaomi'){
-                $this->yimi_advert();
-            }*/
-        }
-        if ($ret) {
-            $data = $this->userInfo('return');
-            $this->success(__('Logged in successful'), $data);
-        } else {
-            $this->error($this->auth->getError());
-        }
-    }
+ 
 
     /**
      * 运营商一键登录

+ 4 - 4
application/config.php

@@ -351,14 +351,14 @@ return [
         'prefix'     => Env::get('redis.REDIS_PREFIX', 'xyy:'),
     ],
 
-    // 运营商一键登录      校友缘 正式
+    // 运营商一键登录      乐见 正式
     'onLogin'        => [
         //
-        'secretid'     => 'd815b73979cbd261882e51e502f398a0',
+        'secretid'     => '665a6e91d84a60e71561abff26c15fc5',
         //
-        'secretkey'      => '401271192248b79757a10dd44482c63f',
+        'secretkey'      => '259bc7c9eabd997ccdd0b7bf11829441',
         //
-        'businessid'      => '779931af6df647c2a0ac0d0f72bcf932',
+        'businessid'      => '9e0443db83d04705b4768dca19350fc1',
     ],
 
     //乐见 正式