1
0

yanzmAction.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * 获取验证码接口
  4. */
  5. class yanzmClassAction extends apiAction
  6. {
  7. public function initAction()
  8. {
  9. $this->display= false;
  10. }
  11. /**
  12. * 获取验证码的
  13. */
  14. public function indexAction()
  15. {
  16. $mobile = $this->rock->jm->uncrypt($this->post('mobile'));
  17. if(!c('check')->ismobile($mobile))return returnerror('手机号格式有误');
  18. $device = $this->post('device');
  19. if(isempt($device))return returnerror('无效访问');
  20. return c('xinhuapi')->getvercode($mobile, $device);
  21. }
  22. /**
  23. * 登录时候
  24. */
  25. public function gloginAction()
  26. {
  27. $mobile = $this->post('mobile');
  28. if(isempt($mobile))return returnerror('手机号不能为空');
  29. if($this->rock->isjm($mobile))$mobile = $this->jm->uncrypt($mobile);
  30. if(!c('check')->ismobile($mobile))return returnerror('手机号格式有误');
  31. $device = $this->post('device');
  32. if(isempt($device))return returnerror('无效访问');
  33. //判断是否有注册
  34. if(m('admin')->rows("`mobile`='$mobile' and `status`=1")==0)return returnerror('此手机号不存在/已停用');
  35. return c('xinhuapi')->getvercode($mobile, $device);
  36. }
  37. }
粤ICP备19079148号