修复PHP两个bug:1.land_api.php玩家端token验证兼容POST(changeVisitorRole等POST请求不再误报需要登录);2.player.php成员权限toggle检测逻辑修正(isCustom原本查span但自定义文字在div里,导致永远走无自定义分支只能给不能撤)

This commit is contained in:
ypsdf1
2026-07-10 22:51:04 +08:00
parent b67480d073
commit a28083f4ca
2 changed files with 10 additions and 5 deletions
+8 -3
View File
@@ -3483,9 +3483,14 @@ async function toggleMemberPerm(landName, targetPlayer, permKey, el) {
body.set('perm', permKey);
// 从元素中获取当前状态
const statusSpan = el.querySelector('span:last-child');
const isCustom = statusSpan.textContent.includes('自定义');
const isEnabled = statusSpan.textContent.includes('启用');
// 状态文字在 flex div 的最后一个 span 里(✓ 启用 / ✗ 禁用 / 默认)
const spans = el.querySelectorAll('span');
const statusSpan = spans[spans.length - 1]; // 第二个 span 是状态
const statusText = statusSpan ? statusSpan.textContent : '';
const isEnabled = statusText.includes('启用');
// "★ 自定义" 在第二个 div 里
const divs = el.querySelectorAll('div');
const isCustom = divs.length > 1 && divs[divs.length - 1].textContent.includes('自定义');
if (isCustom) {
// 已有自定义:切换启用/禁用