Commit bfcccf29 authored by 蒋林's avatar 蒋林

获取验证码日志

parent 55742db8
...@@ -62,12 +62,12 @@ class Galanz extends BaseController ...@@ -62,12 +62,12 @@ class Galanz extends BaseController
{ {
// $mail= '18611475060@163.com'; // $mail= '18611475060@163.com';
// $pwd = 'aimi1012'; // $pwd = 'aimi1012';
//
// $mail= 'weixiuhui1688@163.com';
// $pwd = 'wxh16888';
$mail= 'weixiuhui1688@163.com'; $mail = 'wxh__8888@163.com';
$pwd = 'wxh16888'; $pwd = 'WXH888888';
// $mail = 'wxh__8888@163.com';
// $pwd = 'WXH888888';
$code = phone_code($mail, $pwd); $code = phone_code($mail, $pwd);
......
...@@ -2,10 +2,12 @@ ...@@ -2,10 +2,12 @@
/** /**
* 验证码解析 * 验证码解析
* @param string $imagePath * @param $imagePath
* @param string $sys
* @param string $account
* @return mixed * @return mixed
*/ */
function get_uuapi($imagePath = '') function get_uuapi($imagePath, $sys='', $account='')
{ {
$CI =& get_instance(); $CI =& get_instance();
$CI->load->library('uuApi', null, 'uuApi'); $CI->load->library('uuApi', null, 'uuApi');
...@@ -16,9 +18,13 @@ function get_uuapi($imagePath = '') ...@@ -16,9 +18,13 @@ function get_uuapi($imagePath = '')
$password = 'ppcc2015!'; $password = 'ppcc2015!';
$CI->uuApi->userLogin($username, $password); $CI->uuApi->userLogin($username, $password);
$result = $CI->uuApi->autoRecognition($imagePath, 1005); $code = $CI->uuApi->autoRecognition($imagePath, 1005);
return $result; //记录日志
$CI->load->model('uuwise_log_model');
$CI->uuwise_log_model->add($sys, $account, strval($code));
return $code;
} }
/** /**
......
...@@ -12,6 +12,7 @@ class SourceGalanz extends Source ...@@ -12,6 +12,7 @@ class SourceGalanz extends Source
{ {
private static $account = []; private static $account = [];
private static $host = 'http://202.104.26.131:3081'; private static $host = 'http://202.104.26.131:3081';
private static $app = 'galanz';
public function __construct($account) public function __construct($account)
{ {
...@@ -73,7 +74,7 @@ class SourceGalanz extends Source ...@@ -73,7 +74,7 @@ class SourceGalanz extends Source
'loguser' => '', 'loguser' => '',
'txtUserCode' => self::$account['username'], 'txtUserCode' => self::$account['username'],
'txtPassword' => self::$account['pwd'], 'txtPassword' => self::$account['pwd'],
'txtCheckCode' => get_uuapi(self::$captchaFilePath), 'txtCheckCode' => get_uuapi(self::$captchaFilePath, self::$app, self::$account['username']),
]; ];
preg_match_all('/<input[^>]+name="([^"]+)"[^>]+value="([^"]*)"/', $content, $arr); preg_match_all('/<input[^>]+name="([^"]+)"[^>]+value="([^"]*)"/', $content, $arr);
......
...@@ -274,13 +274,17 @@ class SourceSuning extends Source ...@@ -274,13 +274,17 @@ class SourceSuning extends Source
} }
foreach ($srvOrder[1] as $key => $val) { foreach ($srvOrder[1] as $key => $val) {
$val = preg_replace('/"\s+/', '"|||', trim($val)); $val = html_entity_decode(trim($val));
$val = preg_replace('/"\s+/', '"|||', $val);
$val = str_replace('="', '||="', $val);
$val = explode('|||', str_replace('"', '', $val)); $val = explode('|||', str_replace('"', '', $val));
if (!empty($val)) { if (!empty($val)) {
foreach ($val as $vall) { foreach ($val as $vall) {
$vall = explode("=", $vall); if (stripos($vall, '||=') !== false) {
$order[$key][$vall[0]] = html_entity_decode($vall[1]); $vall = explode("||=", $vall);
$order[$key][strtolower($vall[0])] = $vall[1];
}
} }
} }
} }
...@@ -403,7 +407,7 @@ class SourceSuning extends Source ...@@ -403,7 +407,7 @@ class SourceSuning extends Source
if ($errorCode[1] == 'needVerifyCode') { if ($errorCode[1] == 'needVerifyCode') {
$verifyCodeUrl = "https://vcs.suning.com/vcs/imageCode.htm?uuid={$post['uuid']}"; $verifyCodeUrl = "https://vcs.suning.com/vcs/imageCode.htm?uuid={$post['uuid']}";
$this->SaveUrlCaptcha($verifyCodeUrl); $this->SaveUrlCaptcha($verifyCodeUrl);
$post['verifyCode'] = get_uuapi(self::$captchaFilePath); $post['verifyCode'] = get_uuapi(self::$captchaFilePath, self::$app, self::$account['username']);
$vcresult = $this->CurlHttpsPost($loginUrl, $post, $headers); $vcresult = $this->CurlHttpsPost($loginUrl, $post, $headers);
$vcresult['data'] = $this->HandelHtmlScript($vcresult['data']); $vcresult['data'] = $this->HandelHtmlScript($vcresult['data']);
......
<?php
/**
* 验证码日志模型
* Class Uuwise_log_model
*/
class Uuwise_log_model extends CI_Model
{
public $table = 'uuwise_log'; //表名
public function add($sys, $account, $code)
{
$insertData = [
'sys_name' => $sys,
'account' => $account,
'code' => $code,
'created_time' => time()
];
$this->db->insert($this->table, $insertData);
return $this->db->insert_id();
}
}
\ No newline at end of file
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