Commit b220f25b authored by 蒋林's avatar 蒋林

苏宁-验证码规则

parent d463a6a5
...@@ -31,7 +31,7 @@ class Suning extends BaseController ...@@ -31,7 +31,7 @@ class Suning extends BaseController
1 => ['u' => '18771093166@163.com', 'p' => 'wgw19771230'], 1 => ['u' => '18771093166@163.com', 'p' => 'wgw19771230'],
]; ];
$key = 1; $key = 0;
self::$testu = $account[$key]['u']; self::$testu = $account[$key]['u'];
self::$testp = $account[$key]['p']; self::$testp = $account[$key]['p'];
} }
......
...@@ -183,11 +183,11 @@ function phone_code($mail, $pwd) ...@@ -183,11 +183,11 @@ function phone_code($mail, $pwd)
if ($num) { if ($num) {
$body = imap_base64(imap_fetchbody($mbox, imap_num_msg($mbox), 1)); $body = imap_base64(imap_fetchbody($mbox, imap_num_msg($mbox), 1));
preg_match('/\d{6}/', $body, $code); preg_match('/验证码[^\d]+(\d{6})/', $body, $code);
preg_match('/2\d{3}-[\s\S]{14}/', $body, $date); preg_match('/2\d{3}-[\s\S]{14}/', $body, $date);
if (isset($code[0]) && isset($date[0])) { if (isset($code[1]) && isset($date[0])) {
$result['code'] = $code[0]; $result['code'] = $code[1];
$result['date'] = $date[0]; $result['date'] = $date[0];
$result['st'] = time() - strtotime($result['date']); $result['st'] = time() - strtotime($result['date']);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment