12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- namespace api\cfloat\controller;
- use api\common\controller\CFloatBaseController;
- use huo\controller\member\Bind;
- use huolib\sms\SmsType;
- class SmsController extends CFloatBaseController {
- public function _initialize() {
- parent::_initialize();
- $this->checkLogin();
- }
-
- public function index() {
- $_param = $this->rq_data;
- $_sms_data = get_val($_param, 'sms', []);
- $_mobile = get_val($_sms_data, 'mobile', '');
- $_type = get_val($_sms_data, 'type', SmsType::SMS_ID_VERIFY);
- $_bind_class = new Bind();
- $_rdata = $_bind_class->smsSend($_mobile, $_type);
- return $this->returnData($_rdata);
- }
-
- public function info() {
- $_mem_id = $this->mem_id;
- $_rdata = (new Bind())->getBindInfo($_mem_id);
- return $this->returnData($_rdata);
- }
-
- public function verifyOldMobile() {
- $_sms_data = get_val($this->rq_data, 'sms', []);
- $_mobile = get_val($_sms_data, 'mobile', '');
- $_type = get_val($_sms_data, 'type', SmsType::SMS_ID_VERIFY);
- $_code = get_val($_sms_data, 'code', '');
- $_bind_class = new Bind();
- $_rdata = $_bind_class->checkOldMobile($_mobile, $_code, $_type);
- return $this->returnData($_rdata);
- }
-
- public function bindPost() {
- $_sms_data = get_val($this->rq_data, 'sms', []);
- $_mobile = get_val($_sms_data, 'mobile', '');
- $_type = get_val($_sms_data, 'type', SmsType::SMS_ID_VERIFY);
- $_code = get_val($_sms_data, 'code', '');
- $_mem_rq = $this->setMemData();
- $_bind_class = new Bind();
- $_rdata = $_bind_class->bindPost($this->mem_id, $_mobile, $_code, $_type, $_mem_rq->getPassword());
- return $this->returnData($_rdata);
- }
- }
|