From f881d5b1729370eac90c92302ee93f0d8bac2e30 Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期五, 07 七月 2023 15:41:42 +0800 Subject: [PATCH] no message --- application/api/controller/User.php | 42 +++++++++++++++++++++++++++++++++--------- 1 files changed, 33 insertions(+), 9 deletions(-) diff --git a/application/api/controller/User.php b/application/api/controller/User.php index ddd822d..9e3e1bb 100644 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -51,6 +51,20 @@ $this->success('鑾峰彇鎴愬姛', $data); } + + /** + * 鏇存柊appclientid + */ + public function UpdateClientId() + { + $pushCid=$this->request->post('pushcid'); + $ModelUser = new ModelUser(); + $userInfo = $ModelUser->where(['id'=>USERID]); + if(empty($userInfo)) $this->success('鎴愬姛',true); + $userInfo->update(['push_cid'=>$pushCid]); + $this->success('鎴愬姛', true); + } + /** * 浼氬憳鐧诲綍 * @@ -86,6 +100,7 @@ $mobile = $this->request->post('mobile'); $captcha = $this->request->post('captcha'); $ismobouth=$this->request->post('ismobouth',false); + $pushCid=$this->request->post('pushCid',false); if (!$mobile || !$captcha) { $this->error(__('Invalid parameters')); } @@ -103,7 +118,7 @@ //濡傛灉宸茬粡鏈夎处鍙峰垯鐩存帴鐧诲綍 $ret = $this->auth->direct($user->id); } else { - $ret = $this->auth->register($mobile, Random::alnum(), '', $mobile, []); + $ret = $this->auth->register($mobile, Random::alnum(), '', $mobile, [],'',[],$pushCid); } if ($ret) { Sms::flush($mobile, 'login'); @@ -213,7 +228,8 @@ $user = $this->auth->getUser(); $mobile = $this->request->post('mobile'); $captcha = $this->request->post('captcha'); - if (!$mobile || !$captcha) { + $isyj=$this->request->post('isyj',false); + if (!$mobile || (!$isyj&&!$captcha)) { $this->error(__('Invalid parameters')); } if (!Validate::regex($mobile, "^1\d{10}$")) { @@ -280,20 +296,26 @@ public function bind_mobile_login() { $wxUser = request()->param('wxUser','','urldecode'); + $pushCid= request()->param('pushCid',''); $wxUser = json_decode($wxUser,true); if(empty($wxUser)) $this->error('寰俊鎺堟潈淇℃伅鑾峰彇澶辫触'); $mobile = $this->request->post('mobile'); $captcha = $this->request->post('captcha'); - if (!$mobile || !$captcha) { + $isyj=$this->request->post('isyj',false); + if (!$mobile || (!$isyj&&!$captcha)) { $this->error(__('Invalid parameters')); } if (!Validate::regex($mobile, "^1\d{10}$")) { $this->error('璇疯緭鍏ユ纭墜鏈哄彿'); } - $result = Sms::check($mobile, $captcha, 'changemobile'); - if (!$result) { - $this->error(__('Captcha is incorrect')); + if(!$isyj) + { + $result = Sms::check($mobile, $captcha, 'changemobile'); + if (!$result) { + $this->error(__('Captcha is incorrect')); + } } + $ModelThird = new ModelThird(); $LogicUser = new LogicUser(); //鍒ゆ柇褰撳墠鎵嬫満鍙锋槸鍚﹀凡缁忕粦瀹氬井淇� @@ -301,11 +323,11 @@ $is_phone_bind = $ModelUser->where(['mobile'=> $mobile])->find(); if(!empty($is_phone_bind)){ $LogicUser->bindWechat($is_phone_bind['id'],$wxUser['headimgurl'],$wxUser['sex'],$wxUser['nickname'],$wxUser['openid']); - $ret = $this->auth->direct($is_phone_bind['id']); + $ret = $this->auth->direct($is_phone_bind['id'],$pushCid); }else{ //鍒ゆ柇寰俊鏄惁宸茬粡缁戝畾 $find_third = $ModelThird->where(['openid'=>$wxUser['openid']])->find(); if(!empty($find_third)) $this->error('褰撳墠寰俊鍙峰凡缁戝畾鍏朵粬璐﹀彿'); - $ret = $this->auth->register('', Random::alnum(), '', $mobile, [],'wechat',$wxUser); + $ret = $this->auth->register('', Random::alnum(), '', $mobile, [],'wechat',$wxUser,$pushCid); } Sms::flush($mobile, 'changemobile'); if ($ret) { @@ -444,9 +466,11 @@ $new_goodsId = request()->param('new_goodsId',''); + $plateform= request()->param('plateform',''); + $LogicUserBrowse = new LogicUserBrowse(); - $res = $LogicUserBrowse->updatefirstfreelog(USERID,$ids,$new_goodsId); + $res = $LogicUserBrowse->updatefirstfreelog(USERID,$ids,$new_goodsId,$plateform); if($res === false) $this->error($LogicUserBrowse->getError()); -- Gitblit v1.9.3