123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?php
- namespace h5wap\wap\controller;
- use h5wap\common\controller\V2BaseController;
- use huo\controller\member\Bind;
- use huo\controller\member\MemCache;
- use huolib\sms\SmsType;
- use huolib\tool\StrUtils;
- use think\Session;
- class BindController extends V2BaseController {
- public function _initialize() {
- parent::_initialize();
- $this->checkLogin();
- }
-
- public function bindMobile() {
- $_bind_class = new Bind();
- $_mobile = $_bind_class->getHasBindMobile($this->mem_id);
- $this->assign('CheckOk', $_bind_class->getCheckOk());
- if (!empty($_mobile)) {
-
- $_mobile = StrUtils::encryptPhone($_mobile);
-
- $this->assign('mobile', $_mobile);
- if ($_bind_class->getCheckOk()) {
-
- return $this->fetch('bind/bind');
- } else {
- return $this->fetch('bind/check');
- }
- } else {
-
- return $this->fetch('bind/bind');
- }
- }
-
- public function smsSend() {
- $_sms_data = get_val($this->rq_data, '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 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);
- }
- }
|