Commit 14fcb105 authored by jianghaiming's avatar jianghaiming

update:set

parent e7fa0b7d
......@@ -8,9 +8,9 @@ class IdCertification
{
private const key = '_v7QkFPgzb887YD6BuBqzHPJMJalJ6Zt';
private const secret = 'mDenoicZs2U_wd2jVmQQpCOPeM8jaFRu';
private const kuangshi_ocr_url = 'https://api.megvii.com/faceid/v3/ocridcard';
private const kuangshi_get_token = 'https://api.megvii.com/faceid/v3/sdk/get_biz_token';
private const kuangshi_face_compare = 'https://api.megvii.com/faceid/v3/sdk/verify';
public const kuangshi_ocr_url = 'https://api.megvii.com/faceid/v3/ocridcard';
public const kuangshi_get_token = 'https://api.megvii.com/faceid/v3/sdk/get_biz_token';
public const kuangshi_face_compare = 'https://api.megvii.com/faceid/v3/sdk/verify';
/**
* 身份证合法校验
......@@ -232,6 +232,7 @@ class IdCertification
$final_data['birth_year'] = $ocr_data['response']['birth_year']['result'] ?? '';
$final_data['completeness'] = $ocr_data['response']['completeness'] ?? -1;
$final_data['legality'] = $ocr_data['response']['legality'] ?? (object)[];
$final_data['code'] = $ocr_data['response']['code'] ?? -1;
return $final_data;
}
......@@ -247,6 +248,7 @@ class IdCertification
$final_data['valid_date_end'] = $ocr_data['response']['valid_date_end']['result'] ?? '';
$final_data['completeness'] = $ocr_data['response']['completeness'] ?? -1;
$final_data['legality'] = $ocr_data['response']['legality'] ?? (object)[];
$final_data['code'] = $ocr_data['response']['code'] ?? -1;
return $final_data;
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@ class SocialCreditCertification
{
private const account = 'BJyimingzhineng';
private const app_key = 'deee9c9877e5452f8838cfc5130ac5ad';
private const ocr_bussiness_url = 'http://apistore.xmturui.com/apistore/ocr-new';
public const ocr_bussiness_url = 'http://apistore.xmturui.com/apistore/ocr-new';
private const engine_type = 'blic-new';
/**
......
......@@ -8,7 +8,7 @@ class ThreeElementsCertification
{
private const app_key = '392df35aa98721c597cf20b85d21eebc';
//运营商三要素检测接口
private const test_mobile3_ele_Sim_url = 'https://api.goodsdatas.com:8443/credit/Mobile3EleSim';
public const test_mobile3_ele_Sim_url = 'https://api.goodsdatas.com:8443/credit/Mobile3EleSim';
//加密需要的相关参数
private const salt = 'A99BC8325635E303';
......
......@@ -263,11 +263,12 @@ class Daemon
*/
protected function set_base_config(){
ini_set("display_errors", 1);
error_reporting('E_ALL');
ini_set('date.timezone','Asia/Shanghai');
ini_set("memory_limit", '2048M');
error_reporting(E_ALL);
//日志存储到 php-error.log
/*
//创建任务日志文件
$log_dir = ROOT_PATH.'/logs/daemon/'.$this->task_name;
$log_path = $log_dir.'/'.$this->task_name.'.log';
......@@ -280,6 +281,7 @@ class Daemon
die($log_path."文件无法创建"."\n");
}
}
*/
$this->log_signature = "daemon:".$this->task_name;
}
......
......@@ -14,6 +14,7 @@ use Api\PhpUtils\Common\TimeOut;
use Api\PhpUtils\Http\Request;
use App\Exception\custom\CodeSpecialException;
use Api\PhpUtils\Log\FileLog;
use Api\PhpUtils\Mon\MonUtil;
class JwUser
{
......@@ -61,7 +62,16 @@ class JwUser
$params = ["userId" => $params['user_id']];
//$user_info = (new TimeOut())->runPost($url, $params);
$user_info = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user');
$begin = microtime(true);
$user_info = (new Request())->post($url, $params);
$end = microtime(true);
$total_time = round(($end - $begin),4) * 1000;
if(!empty($user_info['response'])){
$code = $user_info['response']['code'];
}else{
$code = -1;
}
MonUtil::proxyMon($url, $code, 'jw_user', $total_time);
FileLog::info('jw_user_getUserByUserId', json_encode($user_info));
if (!$user_info) {
throw new CodeSpecialException("timeout");
......
......@@ -47,7 +47,7 @@ class Ks3Api
"signature" => $signature,
"type" => $type,
];
return HttpUtil::POST($url, $params);
return HttpUtil::post($url, $params);
}
/**
......@@ -59,12 +59,11 @@ class Ks3Api
* @param $headers
* @return array
*/
public static function signature($resource, $httpMethod, $contentType, $contentMd5, $headers)
public static function signature($resource, $httpMethod, $contentType, $contentMd5, $headers, $date)
{
$url = self::BASE_URL . self::PATH_SIGNATURE;
$timestamp = self::msectime();
$date = gmdate(self::KS_DATE_SCHEME);
$md5Str = $httpMethod . "&" . $contentType . "&" . $contentMd5 . "&" . $date . "&" . $resource . "&" . $headers . "&" . $timestamp . "&" . self::KSYUN_SK;
$signature = self::KSYUN_AK . ":" . md5($md5Str);
......@@ -79,7 +78,7 @@ class Ks3Api
"resource" => $resource,
"headers" => $headers,
];
return HttpUtil::POST($url, $params);
return HttpUtil::post($url, $params);
}
/**
......@@ -113,7 +112,7 @@ class Ks3Api
"content_type" => $contentType,
"extend" => $extendJsonStr,
];
return HttpUtil::POST($url, $params);
return HttpUtil::post($url, $params);
}
/**
......@@ -140,7 +139,7 @@ class Ks3Api
"signature" => $signature,
"extend" => $extendJsonStr,
];
return HttpUtil::POST($url, $params);
return HttpUtil::post($url, $params);
}
/**
......
......@@ -2,6 +2,7 @@
namespace Api\PhpServices\Ksy;
use Api\PhpUtils\Http\Request;
use Api\PhpUtils\Mon\MonUtil;
class Ksyun
{
......@@ -39,8 +40,16 @@ class Ksyun
'bucket' => $bucket,
'expire' => $expire_time,
];
$begin = microtime(true);
$res = (new Request())->post(self::get_down_from_ksyun, $post_data,50, 'json',[],1,true);
$end = microtime(true);
$total_time = round(($end - $begin),4) * 1000;
if(isset($res['response']['code'])){
$code = $res['response']['code'];
}else{
$code = -1;
}
MonUtil::proxyMon(self::get_down_from_ksyun, $code, 'merchant', $total_time);
if (isset($res['code'],$res['response']['status']) && $res['response']['status'] === 'success') {
return $res['response']['data'];
}
......
......@@ -252,7 +252,44 @@ class GetImage
return $image_thump;
}
private function curlImage($url, $save_dir='',$filename='',$type=0){
$mimes = array(
'image/bmp'=>'bmp',
'image/gif'=>'gif',
'image/jpeg'=>'jpg',
'image/png'=>'png',
'image/tiff'=>'tiff',
'image/x-icon'=>'ico',
'mage/vnd.wap.wbmp'=>'wbmp',
'image/fax'=>'fax',
'image/pnetvue'=>'net',
'image/vnd.rn-realpix'=>'rp'
);
//创建保存目录
if(!file_exists($save_dir)&&!mkdir($save_dir,0777,true)){
return false;
}
// 获取响应头
if(($headers = get_headers($url, 1))!==false){
$type = $headers['Content-Type'];
if(isset($mimes[$type]))
{
$this->extension = $mimes[$type];
$file_path = $save_dir.$filename.".".$this->extension;
$contents = file_get_contents($url);
if(file_put_contents($file_path , $contents))
{
return $save_dir.$filename.".".$this->extension;
}
}
}
}
private function curlImageBak($url, $save_dir='',$filename='',$type=0){
if(trim($url)==''){
return array('file_name'=>'','save_path'=>'','error'=>1);
}
......
This diff is collapsed.
......@@ -10,7 +10,7 @@ use Api\PhpUtils\Redis\RedisUtil;
class FrequencyLockUtil
{
const MIN_FREQUENCY_SECONDS = 30; // 频率锁默认最小间隔秒数
const MIN_FREQUENCY_SECONDS = 3; // 频率锁默认最小间隔秒数
const MIN_FREQUENCY_TIMES = 1; // 频率锁默认最小间隔秒数内最大访问次数
const PREFIX_FREQUENCY_LOCK = 'flk:';
......
......@@ -32,7 +32,7 @@ private static $installed = array (
'aliases' =>
array (
),
'reference' => '4f8e8782a402f2ef95b6b5b9b21c23da94816828',
'reference' => 'e7fa0b7dd9584f3f9c8b489b4351a6b4858f62ea',
'name' => 'yidian/yaf_demo',
),
'versions' =>
......@@ -45,7 +45,7 @@ private static $installed = array (
array (
0 => '9999999-dev',
),
'reference' => 'f7b44c008d561d3785797073d0eb875fb2f16756',
'reference' => '03c3e30e32f69eb439eb9e116adc0da98538c11b',
),
'api/php_utils' =>
array (
......@@ -55,7 +55,7 @@ private static $installed = array (
array (
0 => '9999999-dev',
),
'reference' => 'e4bc1258fafead42eb6ac7b84ae743f08d557a99',
'reference' => '3651661da73b73fd8c5a02db0667f3937f4875f8',
),
'bacon/bacon-qr-code' =>
array (
......@@ -196,11 +196,10 @@ private static $installed = array (
),
'psr/log' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'pretty_version' => '1.1.4',
'version' => '1.1.4.0',
'aliases' =>
array (
0 => '1.1.x-dev',
),
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
),
......@@ -299,7 +298,7 @@ private static $installed = array (
array (
0 => '1.23.x-dev',
),
'reference' => 'eca0bf41ed421bed1b57c4958bab16aa86b757d0',
'reference' => '19d03c391c6abb6791f5f757fb36e551bffeaa68',
),
'symfony/property-access' =>
array (
......@@ -335,7 +334,7 @@ private static $installed = array (
'aliases' =>
array (
),
'reference' => '4f8e8782a402f2ef95b6b5b9b21c23da94816828',
'reference' => 'e7fa0b7dd9584f3f9c8b489b4351a6b4858f62ea',
),
),
);
......
......@@ -102,6 +102,7 @@ return array(
'App\\Models\\goods\\mysql\\GoodsSnapshot' => $baseDir . '/application/models/goods/mysql/GoodsSnapshot.php',
'App\\Models\\goods\\mysql\\GoodsSpu' => $baseDir . '/application/models/goods/mysql/GoodsSpu.php',
'App\\Models\\goods\\mysql\\InventoryOperationRecord' => $baseDir . '/application/models/goods/mysql/InventoryOperationRecord.php',
'App\\Models\\goods\\mysql\\LifeAccountShopNum' => $baseDir . '/application/models/goods/mysql/LifeAccountShopNum.php',
'App\\Models\\goods\\mysql\\PaySuccessGoodsCallbackRecord' => $baseDir . '/application/models/goods/mysql/PaySuccessGoodsCallbackRecord.php',
'App\\Models\\goods\\mysql\\Shop' => $baseDir . '/application/models/goods/mysql/Shop.php',
'App\\Models\\goods\\mysql\\Tcc' => $baseDir . '/application/models/goods/mysql/Tcc.php',
......
......@@ -331,6 +331,7 @@ class ComposerStaticInit90e85a2e64f8339192f3e91b8700b9f2
'App\\Models\\goods\\mysql\\GoodsSnapshot' => __DIR__ . '/../..' . '/application/models/goods/mysql/GoodsSnapshot.php',
'App\\Models\\goods\\mysql\\GoodsSpu' => __DIR__ . '/../..' . '/application/models/goods/mysql/GoodsSpu.php',
'App\\Models\\goods\\mysql\\InventoryOperationRecord' => __DIR__ . '/../..' . '/application/models/goods/mysql/InventoryOperationRecord.php',
'App\\Models\\goods\\mysql\\LifeAccountShopNum' => __DIR__ . '/../..' . '/application/models/goods/mysql/LifeAccountShopNum.php',
'App\\Models\\goods\\mysql\\PaySuccessGoodsCallbackRecord' => __DIR__ . '/../..' . '/application/models/goods/mysql/PaySuccessGoodsCallbackRecord.php',
'App\\Models\\goods\\mysql\\Shop' => __DIR__ . '/../..' . '/application/models/goods/mysql/Shop.php',
'App\\Models\\goods\\mysql\\Tcc' => __DIR__ . '/../..' . '/application/models/goods/mysql/Tcc.php',
......
......@@ -7,7 +7,7 @@
"source": {
"type": "git",
"url": "https://git.yidian-inc.com:8021/bp/php_services.git",
"reference": "f7b44c008d561d3785797073d0eb875fb2f16756"
"reference": "03c3e30e32f69eb439eb9e116adc0da98538c11b"
},
"require": {
"api/php_utils": "dev-master",
......@@ -15,7 +15,7 @@
"perftools/php-profiler": "^0.18.0",
"php": "7.2.*"
},
"time": "2021-07-14T09:06:17+00:00",
"time": "2021-07-17T15:33:26+00:00",
"default-branch": true,
"type": "library",
"installation-source": "source",
......@@ -34,7 +34,7 @@
"source": {
"type": "git",
"url": "https://git.yidian-inc.com:8021/bp/php_utils.git",
"reference": "e4bc1258fafead42eb6ac7b84ae743f08d557a99"
"reference": "3651661da73b73fd8c5a02db0667f3937f4875f8"
},
"require": {
"elasticsearch/elasticsearch": "~7.0",
......@@ -46,7 +46,7 @@
"mongodb/mongodb": "1.4.3",
"php": "7.2.*"
},
"time": "2021-07-14T08:30:41+00:00",
"time": "2021-07-14T14:21:31+00:00",
"default-branch": true,
"type": "library",
"installation-source": "source",
......@@ -950,8 +950,8 @@
},
{
"name": "psr/log",
"version": "dev-master",
"version_normalized": "dev-master",
"version": "1.1.4",
"version_normalized": "1.1.4.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
......@@ -967,7 +967,6 @@
"php": ">=5.3.0"
},
"time": "2021-05-03T11:20:27+00:00",
"default-branch": true,
"type": "library",
"extra": {
"branch-alias": {
......@@ -1685,18 +1684,18 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0"
"reference": "19d03c391c6abb6791f5f757fb36e551bffeaa68"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0",
"reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/19d03c391c6abb6791f5f757fb36e551bffeaa68",
"reference": "19d03c391c6abb6791f5f757fb36e551bffeaa68",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"time": "2021-02-19T12:13:01+00:00",
"time": "2021-07-13T14:34:27+00:00",
"default-branch": true,
"type": "library",
"extra": {
......@@ -1747,7 +1746,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0"
"source": "https://github.com/symfony/polyfill-php80/tree/main"
},
"funding": [
{
......
......@@ -6,7 +6,7 @@
'aliases' =>
array (
),
'reference' => '4f8e8782a402f2ef95b6b5b9b21c23da94816828',
'reference' => 'e7fa0b7dd9584f3f9c8b489b4351a6b4858f62ea',
'name' => 'yidian/yaf_demo',
),
'versions' =>
......@@ -19,7 +19,7 @@
array (
0 => '9999999-dev',
),
'reference' => 'f7b44c008d561d3785797073d0eb875fb2f16756',
'reference' => '03c3e30e32f69eb439eb9e116adc0da98538c11b',
),
'api/php_utils' =>
array (
......@@ -29,7 +29,7 @@
array (
0 => '9999999-dev',
),
'reference' => 'e4bc1258fafead42eb6ac7b84ae743f08d557a99',
'reference' => '3651661da73b73fd8c5a02db0667f3937f4875f8',
),
'bacon/bacon-qr-code' =>
array (
......@@ -170,11 +170,10 @@
),
'psr/log' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'pretty_version' => '1.1.4',
'version' => '1.1.4.0',
'aliases' =>
array (
0 => '1.1.x-dev',
),
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
),
......@@ -273,7 +272,7 @@
array (
0 => '1.23.x-dev',
),
'reference' => 'eca0bf41ed421bed1b57c4958bab16aa86b757d0',
'reference' => '19d03c391c6abb6791f5f757fb36e551bffeaa68',
),
'symfony/property-access' =>
array (
......@@ -309,7 +308,7 @@
'aliases' =>
array (
),
'reference' => '4f8e8782a402f2ef95b6b5b9b21c23da94816828',
'reference' => 'e7fa0b7dd9584f3f9c8b489b4351a6b4858f62ea',
),
),
);
......@@ -16,7 +16,7 @@ This component provides features added to PHP 8.0 core:
- [`get_resource_id`](https://php.net/get_resource_id)
More information can be found in the
[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md).
[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md).
License
=======
......
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