From 71b7783aa0eb04f9e6571ac78de50227942f3664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E8=90=BD?= Date: Sun, 22 Mar 2020 21:34:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=94=AF=E4=BB=98=E7=9A=84?= =?UTF-8?q?=E5=87=A0=E4=B8=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/js/gdk.js | 4 ++-- functions/Ajax.php | 23 +++++++++-------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/assets/js/gdk.js b/assets/js/gdk.js index 5147437..50e21ae 100644 --- a/assets/js/gdk.js +++ b/assets/js/gdk.js @@ -1,6 +1,6 @@ jQuery(function ($) { /**声明加载jQuery */ - function glog(a){ + function glog(a) { console.log(a); } /** @@ -296,7 +296,7 @@ jQuery(function ($) { /**声明加载jQuery */ closeOnClickOutside: false, content: "input", }).then((d) => { /**提取码 */ - glog('提取码为:' + d ); + glog('提取码为:' + d); get_content(a); add_code(a, `${d}`); }); //ok diff --git a/functions/Ajax.php b/functions/Ajax.php index 2f347bb..bd2aeab 100644 --- a/functions/Ajax.php +++ b/functions/Ajax.php @@ -32,7 +32,7 @@ function gdk_ajax_get_update() $plugin_info = json_decode($response['body'], true); $version = $plugin_info['version']; - if (!version_compare($version, GDK_PLUGIN_VER, '<')) { + if (version_compare($version, GDK_PLUGIN_VER, '>')) { exit('插件有更新,新版本:' . $version . ' '); } else { exit('你的插件目前已经是最新版了!'); @@ -136,10 +136,9 @@ function pay_points() if (!isset($_POST['money']) || !isset($_POST['way'])) { exit('400'); - } -//无脑输出400错误 + } //无脑输出400错误 if (isset($_POST['id'])) { - payjs_action('积分充值', $_POST['id']); + payjs_action('积分充值', $_POST['id'], $_POST['money']); } } add_action('wp_ajax_pay_points', 'pay_points'); @@ -154,8 +153,7 @@ function check_pay_points() if (!isset($_POST['id']) || !isset($_POST['orderid'])) { exit('400'); - } -//无脑输出400错误 + } //无脑输出400错误 if ($_POST['action'] == 'check_pay_points') { if (gdk_check($_POST['orderid'], $_POST['id'])) { exit('200'); @@ -181,7 +179,7 @@ function pay_view() } //无脑输出400错误 if (isset($_POST['id'])) { - payjs_action('在线付费查看', 'PP' . $_POST['id']); //标题,文章id + payjs_action('在线付费查看', 'PP' . $_POST['id'], $_POST['money']); //标题,文章id } } add_action('wp_ajax_pay_view', 'pay_view'); @@ -223,10 +221,9 @@ function check_code() exit('400'); } - if (!isset($code) || !isset($action) || !isset($id)) { + if (empty($code) || !isset($action) || !isset($id)) { exit('400'); - } -//无脑输出400错误 + } //无脑输出400错误 if ($action == 'check_code') { $code = trim($code); //清理一下 $pay_log = get_post_meta($id, 'pay_log', true); //购买记录数据 @@ -246,8 +243,7 @@ function get_content() { if (!isset($_POST['action']) || $_POST['action'] !== 'get_content') { exit('400'); - } -//无脑输出400错误 + } //无脑输出400错误 if (isset($_POST['id'])) { $pay_content = get_post_meta($_POST['id'], '_pay_content', true); exit($pay_content); @@ -265,8 +261,7 @@ function check_pay_view() if (!isset($_POST['id']) || !isset($_POST['orderid'])) { exit('400'); - } -//无脑输出400错误 + } //无脑输出400错误 if ($_POST['action'] == 'check_pay_view') { $sid = get_transient('PP' . $_POST['id']); if (in_string($sid, 'E20') && $_POST['orderid'] == $sid) {