Browse Source

update

master
DengBiao 1 year ago
parent
commit
8416d98ca0
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/applet/app/controllers/Alipay/DecryptController.php

+ 4
- 1
src/applet/app/controllers/Alipay/DecryptController.php View File

@@ -18,8 +18,11 @@ class DecryptController extends ControllerBase
$args = $this->request->getJsonRawBody(true); $args = $this->request->getJsonRawBody(true);
$aesKey = $args["aes_key"] ?? "n1UenLsnSPxi2KsTv3y/0Q=="; //AES密钥 $aesKey = $args["aes_key"] ?? "n1UenLsnSPxi2KsTv3y/0Q=="; //AES密钥
$content = $args["content"] ?? "Ho5y3nixH0tSnYWw8p/HMTO1bIONKSYd7BfkbI+ww4qgJEXKMYFWnSwjXN2B9YwvsKBYykK2gva2v1jfnQVSNQ=="; $content = $args["content"] ?? "Ho5y3nixH0tSnYWw8p/HMTO1bIONKSYd7BfkbI+ww4qgJEXKMYFWnSwjXN2B9YwvsKBYykK2gva2v1jfnQVSNQ==";
$this->logger($args, 'Decrypt', true);
$result = openssl_decrypt(base64_decode($content), 'AES-128-CBC', base64_decode($aesKey), OPENSSL_RAW_DATA); $result = openssl_decrypt(base64_decode($content), 'AES-128-CBC', base64_decode($aesKey), OPENSSL_RAW_DATA);
$this->logger([
"args" => $args,
"content" => $content,
], 'Decrypt', true);
if (!$result) { if (!$result) {
$this->api(Msg::NewError(500, 'AES解密失败!')); $this->api(Msg::NewError(500, 'AES解密失败!'));
} }


Loading…
Cancel
Save