1
0
Files
helper/application/mobile/controller/Sms.php
2023-11-16 14:33:38 +08:00

61 lines
1.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +------------------------------------------------+
// |http://www.cjango.com |
// +------------------------------------------------+
// | 修复BUG不是一朝一夕的事情等我喝醉了再说吧 |
// +------------------------------------------------+
// | Author: 小陈叔叔 <Jason.Chen> |
// +------------------------------------------------+
namespace app\mobile\controller;
use app\common\model\Member as MemberModel;
use app\common\service\Sms as SmsService;
class Sms extends _Init
{
public function _initialize()
{
}
/**
* [短信验证码]
*
* @return [type] [description]
*/
public function getsms()
{
$mobile = $this->request->post('mobile');
$forget = $this->request->post('forget');
$MemberInfo = MemberModel::where('username', $mobile)->find();
if (! empty($MemberInfo) && empty($forget)) {
return $this->error('这个手机号已经注册过了');
}
$res = SmsService::send($mobile);
if ($res === true) {
return $this->success('发送成功:短信验证码6666');
} else {
return $this->error($res);
}
}
/**
* [短信验证码]
*
* @return [type] [description]
*/
public function getresms()
{
$mobile = $this->request->post('mobile');
$MemberInfo = MemberModel::where('username', $mobile)->find();
$res = SmsService::send($mobile);
if ($res === true) {
return $this->success('发送成功');
} else {
return $this->error($res);
}
}
}