优化插件更新逻辑

This commit is contained in:
技术老胡
2024-09-05 15:26:03 +08:00
parent ce65756874
commit 461f574b9d
15 changed files with 84 additions and 73 deletions

View File

@@ -4,15 +4,16 @@ class MpayClass
{
private $pid;
private $key;
private $host = 'https://mpay.zhaidashi.cn/';
private $host;
private $check_neworder_url;
private $submit_records_url;
function __construct($config)
{
$this->pid = $config['pid'];
$this->key = $config['key'];
$this->check_neworder_url = $this->host . 'order.php';
$this->submit_records_url = $this->host . 'payHeart';
$this->host = $config['host'];
$this->check_neworder_url = $this->host . '/order.php';
$this->submit_records_url = $this->host . '/payHeart';
}
// 查询新订单
public function orderHeart()

View File

@@ -17,13 +17,13 @@ class ShouQianBa
$this->username = $config['username'];
$this->password = $config['password'];
// 检查token目录
$dir_path = runtime_path() . 'token/shouqianba';
$dir_path = runtime_path() . 'token/sqbpay';
if (!is_dir($dir_path)) {
if (!mkdir($dir_path, 755, true)) {
echo '目录创建失败';
}
}
$this->token_path = $dir_path . '/' . md5($this->username . $this->password . 'ShouQianBa') . '.json';
$this->token_path = $dir_path . '/' . md5($this->username . $this->password . 'sqbpay') . '.json';
if (!file_exists($this->token_path)) {
// 失效Token刷新
$token_info = ['token' => 'Y2FjZmRiMi04MjRjLTQ2NDgtYTU0Ny1lNzg2MDllMTQ1ZTI6MTcxOTQ1Mzg0MzU3OTozNjAwMDAw.txcnX60Za8', 'expire_time' => 1719453843579];