加解密优化
This commit is contained in:
@@ -98,25 +98,6 @@ class Cors extends ActionFilter
|
||||
'Access-Control-Expose-Headers' => [],
|
||||
];
|
||||
|
||||
private static $arr = [
|
||||
'name',
|
||||
'contact',
|
||||
'mobile',
|
||||
'express_address',
|
||||
'clinical_diagnose',
|
||||
'drug_name',
|
||||
'drug_alias',
|
||||
'function',
|
||||
'usage',
|
||||
'express_mobile',
|
||||
'express_name',
|
||||
'express_region',
|
||||
'doctor',
|
||||
'accept_tel',
|
||||
'patient',
|
||||
'accept_name',
|
||||
'patient_mobile'
|
||||
];
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -323,7 +304,7 @@ class Cors extends ActionFilter
|
||||
if (is_array($value)) {
|
||||
$value = self::aseDecode($value); // 递归处理子数组
|
||||
} else {
|
||||
if (in_array($key, self::$arr)) {
|
||||
if (in_array($key, \Yii::$app->params['aseList'])) {
|
||||
$value = ase_decode($value); // 加密指定键值
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,25 +14,6 @@ use yii\helpers\Json;
|
||||
|
||||
class JsonResponseFormatter extends \yii\web\JsonResponseFormatter
|
||||
{
|
||||
private static $arr = [
|
||||
'name',
|
||||
'contact',
|
||||
'mobile',
|
||||
'express_address',
|
||||
'clinical_diagnose',
|
||||
'drug_name',
|
||||
'drug_alias',
|
||||
'function',
|
||||
'usage',
|
||||
'express_mobile',
|
||||
'express_name',
|
||||
'express_region',
|
||||
'doctor',
|
||||
'accept_tel',
|
||||
'patient',
|
||||
'accept_name',
|
||||
'patient_mobile'
|
||||
];
|
||||
private static $param = [
|
||||
'param' => [],
|
||||
'result' => [],
|
||||
@@ -64,7 +45,7 @@ class JsonResponseFormatter extends \yii\web\JsonResponseFormatter
|
||||
if (is_array($value)) {
|
||||
$value = self::aseEncode($value); // 递归处理子数组
|
||||
} else {
|
||||
if (in_array($key, self::$arr)) {
|
||||
if (in_array($key, \Yii::$app->params['aseList'])) {
|
||||
$value = ase_encode($value); // 加密指定键值
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,6 +133,25 @@ JJvBfLfudYNUjUCyW3gAcOIJ
|
||||
'url' => 'http://115.238.71.206:28093',
|
||||
'userid' => '23774',
|
||||
'secret' => '61ce8912-25e6-46cf-82eb-81412294a53d'
|
||||
],
|
||||
'aseList' => [
|
||||
'name',
|
||||
'contact',
|
||||
'mobile',
|
||||
'express_address',
|
||||
'clinical_diagnose',
|
||||
'drug_name',
|
||||
'drug_alias',
|
||||
'function',
|
||||
'usage',
|
||||
'express_mobile',
|
||||
'express_name',
|
||||
'express_region',
|
||||
'doctor',
|
||||
'accept_tel',
|
||||
'patient',
|
||||
'accept_name',
|
||||
'patient_mobile'
|
||||
]
|
||||
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user