From 0dcf542b30f47c919d1aabc197a03c2821580d60 Mon Sep 17 00:00:00 2001 From: ranfey <2219349024@qq.com> Date: Sun, 9 Aug 2026 18:56:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=84=E8=AE=BA=E7=A7=81=E5=AF=86?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=9C=AA=E6=8E=88=E6=9D=83=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E5=92=8C=E6=97=A0=E6=B3=95=E5=8F=96=E6=B6=88=E7=A7=81=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/index.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/page/index.js b/src/page/index.js index c55a751..6b98bb9 100644 --- a/src/page/index.js +++ b/src/page/index.js @@ -236,17 +236,13 @@ function sm() { cm.addEventListener("click", (e) => { let list = e.target.parentNode; if (list.classList.contains("sm")) { - let msg = __("您真的要设为私密吗?"); + let msg = __("您确定要切换私密状态吗?"); if (confirm(msg) == true) { - if (list.classList.contains('private_now')) { - alert(__('您之前已设过私密评论')); - return false; - } else { - list.classList.add('private_now'); let idp = list.getAttribute("data-idp"), actionp = list.getAttribute("data-actionp"), - rateHolderp = list.getElementsByClassName('has_set_private')[0]; - let ajax_data = "action=siren_private&p_id=" + idp + "&p_action=" + actionp; + rateHolderp = list.getElementsByClassName('has_set_private')[0], + noncep = list.getAttribute("data-noncep"); + let ajax_data = "action=siren_private&p_id=" + idp + "&p_action=" + actionp + "&_wpnonce=" + noncep; let request = new XMLHttpRequest(); request.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { @@ -257,7 +253,6 @@ function sm() { request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); request.send(ajax_data); return false; - } } } })