修复一些小问题

This commit is contained in:
技术老胡 2024-11-11 15:58:19 +08:00
parent cd38b4cc04
commit 4b5e8bb763
7 changed files with 23 additions and 12 deletions

View File

@ -21,9 +21,7 @@ class IndexController
} }
public function test() public function test()
{ {
$pay = new \payclient\PayClass(['username'=>1531,'password'=>15646]); $web = \request()->domain();
return $web;
return '123';
} }
} }

View File

@ -195,11 +195,11 @@ class PayController
foreach ($new_orders as $new_order) { foreach ($new_orders as $new_order) {
foreach ($activeOrders as $order) { foreach ($activeOrders as $order) {
// 支付方式核对 // 支付方式核对
$is_payway = $order->type === $new_order['payway']; $is_payway = $order->type == $new_order['payway'];
// 支付渠道核对 // 支付渠道核对
$is_channel = $cids[$order->cid] === $new_order['channel']; $is_channel = $cids[$order->cid] == $new_order['channel'];
// 金额核对 // 金额核对
$is_money = $order->money === $new_order['price']; $is_money = $order->money == $new_order['price'];
// 订单核对 // 订单核对
if ($is_payway && $is_channel && $is_money) { if ($is_payway && $is_channel && $is_money) {
$res = $this->updateOrderState($order, $new_order['order_no']); $res = $this->updateOrderState($order, $new_order['order_no']);

View File

@ -13,6 +13,8 @@ class PayManageController extends BaseController
{ {
public function index() public function index()
{ {
$domain = $this->request->domain();
View::assign('domain', $domain);
return View::fetch(); return View::fetch();
} }
// 编辑账号 // 编辑账号

View File

@ -5,8 +5,6 @@ declare(strict_types=1);
namespace app\controller\api; namespace app\controller\api;
use app\BaseController; use app\BaseController;
use app\model\Platform;
use think\facade\View;
class PluginController extends BaseController class PluginController extends BaseController
{ {

View File

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
class MpayClass class MpayClass
{ {
private $pid; private $pid;

View File

@ -1,3 +1,14 @@
<?php <?php
function encrypt($string, $key) {
echo '测试用例'; $method = "AES-256-CBC";
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($method));
$encrypted = openssl_encrypt($string, $method, $key, 0, $iv);
// 将iv和加密字符串拼接起来
return base64_encode($iv . $encrypted);
}
$key = "your-encryption-key"; // 这里应该是一个安全的密钥
$string = "Hello, World!";
$encryptedString = encrypt($string, $key);
echo $encryptedString; // 输出加密字符串

View File

@ -110,7 +110,7 @@
{ title: '密 码', field: 'password', align: 'center' }, { title: '密 码', field: 'password', align: 'center' },
{ title: '启用状态', field: 'state', align: 'center', templet: '#account-state' }, { title: '启用状态', field: 'state', align: 'center', templet: '#account-state' },
{ title: '监听模式', field: 'pattern', align: 'center' }, { title: '监听模式', field: 'pattern', align: 'center' },
{ title: '监听地址', field: 'payurl', align: 'center', templet: `<div>{{# return window.location.origin + '/checkPayResult?pid='+d.pid+'&aid='+d.id }}</div>` }, { title: '监听地址', field: 'payurl', align: 'center', templet: `<div>{{# return '<?php echo $domain ?>/checkPayResult?pid='+d.pid+'&aid='+d.id }}</div>` },
{ title: '终端数量', field: 'channel', align: 'center', templet: '<div><a href="javascript:;" lay-event="channelList"><span class="layui-badge layui-bg-green">{{= d.channel }}</span></a></div>' }, { title: '终端数量', field: 'channel', align: 'center', templet: '<div><a href="javascript:;" lay-event="channelList"><span class="layui-badge layui-bg-green">{{= d.channel }}</span></a></div>' },
{ title: '操作', align: 'center', fixed: 'right', templet: '<div><a href="javascript:;" class="layui-font-green" lay-event="edit"><strong>编辑</strong></a></div>' } { title: '操作', align: 'center', fixed: 'right', templet: '<div><a href="javascript:;" class="layui-font-green" lay-event="edit"><strong>编辑</strong></a></div>' }
]] ]]