|
@@ -812,14 +812,28 @@ class LoginForm extends ApiModel
|
|
|
*/
|
|
*/
|
|
|
public function sendCode($key)
|
|
public function sendCode($key)
|
|
|
{
|
|
{
|
|
|
- if (!$this->phone || !preg_match("/^1[3456789]\d{9}$/", $this->phone)) {
|
|
|
|
|
|
|
+ $is_debug=Option::get('is_debug', 0, 'saas', 0)['value'];
|
|
|
|
|
+ if(preg_match("/^111\d{8}$/", $this->phone) && $is_debug == 1){
|
|
|
|
|
+ $sms_code = 999999;
|
|
|
|
|
+ // 验证码有效期5分钟
|
|
|
|
|
+ cache()->set($this->phone . $key . $this->store_id, $sms_code, 600);
|
|
|
|
|
+ //debug_log([__METHOD__, __LINE__, "KEY:".$this->phone . $key . $this->store_id.',code:'.$sms_code], "app_debug.log");
|
|
|
return [
|
|
return [
|
|
|
- 'code' => 1,
|
|
|
|
|
- 'msg' => '参数不正确',
|
|
|
|
|
|
|
+ 'code' => 0,
|
|
|
|
|
+ 'msg' => '发送成功',
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
|
|
+ else{
|
|
|
|
|
+ if (!$this->phone || !preg_match("/^1[3456789]\d{9}$/", $this->phone)) {
|
|
|
|
|
+ return [
|
|
|
|
|
+ 'code' => 1,
|
|
|
|
|
+ 'msg' => '参数不正确2',
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$sms_code = mt_rand(100000, 999999);
|
|
$sms_code = mt_rand(100000, 999999);
|
|
|
- $sendResult = NoticeSend::VerifyCode($this->phone, $sms_code);
|
|
|
|
|
|
|
+ $sendResult = NoticeSend::VerifyCode($this->phone, $sms_code,true);
|
|
|
if ($sendResult['code'] == 1) {
|
|
if ($sendResult['code'] == 1) {
|
|
|
return $sendResult;
|
|
return $sendResult;
|
|
|
}
|
|
}
|