input('phone', ''); $password = $request->input('password', ''); $member = Member::where('phone', $phone)->first(); $type = $request->input('type', ''); if( empty($member) ){ return $this->apiResponseError(null,'账号不存在'); } if( empty($type) ){ return $this->apiResponseError(null,'接口类型必传'); } // 短信验证码验证 $sms = $request->input('sms', 'sms'); // 短信验证码是否通过 $result = (new SmsServer())->checkSms($sms, $phone, $type); if( $result['errcode'] === false ){ return $this->apiResponseError(null,$result['errmsg']); } $member->{'password'} = bcrypt($password); $member->{'y_password'} = $password; $result = $member->save(); if( !$result ){ return $this->apiResponseError(null,"修改失败"); } return $this->apiResponseSuccess(null, "修改成功"); } }