Skip to content

Commit

Permalink
避免全局函数encrypt和laravel框架重名
Browse files Browse the repository at this point in the history
  • Loading branch information
hfpf committed May 30, 2019
1 parent 489a952 commit 4b22907
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/AopClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ public function getParams($request)
}

// 执行加密
$enCryptContent = encrypt($apiParams['biz_content'], $this->encryptKey);
$enCryptContent = alipay_encrypt($apiParams['biz_content'], $this->encryptKey);
$apiParams['biz_content'] = $enCryptContent;

}
Expand Down Expand Up @@ -504,7 +504,7 @@ public function execute($request, $authToken = null, $appInfoAuthtoken = null) {
}

// 执行加密
$enCryptContent = encrypt($apiParams['biz_content'], $this->encryptKey);
$enCryptContent = alipay_encrypt($apiParams['biz_content'], $this->encryptKey);
$apiParams['biz_content'] = $enCryptContent;

}
Expand Down Expand Up @@ -1091,7 +1091,7 @@ private function encryptJSONSignSource($request, $responseContent) {
$bodyIndexContent = substr($responseContent, 0, $parsetItem->startIndex);
$bodyEndContent = substr($responseContent, $parsetItem->endIndex, strlen($responseContent) + 1 - $parsetItem->endIndex);

$bizContent = decrypt($parsetItem->encryptContent, $this->encryptKey);
$bizContent = alipay_decrypt($parsetItem->encryptContent, $this->encryptKey);
return $bodyIndexContent . $bizContent . $bodyEndContent;

}
Expand Down Expand Up @@ -1155,7 +1155,7 @@ private function encryptXMLSignSource($request, $responseContent) {

$bodyIndexContent = substr($responseContent, 0, $parsetItem->startIndex);
$bodyEndContent = substr($responseContent, $parsetItem->endIndex, strlen($responseContent) + 1 - $parsetItem->endIndex);
$bizContent = decrypt($parsetItem->encryptContent, $this->encryptKey);
$bizContent = alipay_decrypt($parsetItem->encryptContent, $this->encryptKey);

return $bodyIndexContent . $bizContent . $bodyEndContent;

Expand Down
4 changes: 2 additions & 2 deletions src/AopEncrypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @param string $str
* @return string
*/
function encrypt($str,$screct_key){
function alipay_encrypt($str,$screct_key){
//AES, 128 模式加密数据 CBC
$screct_key = base64_decode($screct_key);
$str = trim($str);
Expand All @@ -27,7 +27,7 @@ function encrypt($str,$screct_key){
* @param string $str
* @return string
*/
function decrypt($str,$screct_key){
function alipay_decrypt($str,$screct_key){
//AES, 128 模式加密数据 CBC
$str = base64_decode($str);
$screct_key = base64_decode($screct_key);
Expand Down

0 comments on commit 4b22907

Please sign in to comment.