15m44m 根治: webhook_secret挪repo段去真实值 + easy不被GitHub压制 + 前端授权按钮 + 独立gh_auth_tokens表不污染工单 + token反解玩家名

This commit is contained in:
ypsdf1
2026-11-25 12:52:25 +08:00
parent 080fdbe23c
commit 00f4db3d3b
6 changed files with 131 additions and 52 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
/**
* 15m44m: 工单前端判断「GitHub issue 同步是否启用」的懒重载端点。
* 返回 {gh_enabled:bool, gh_repo:string}。前端进工单表单时 fetch,
* - gh_enabled=true 才显示「授权 GitHub 工单同步」按钮
* - gh_repo 用于按钮文案(caoyuanwiki)
* 无 token(配置非敏感)。
*/
while (ob_get_level() > 0) { @ob_end_clean(); }
ob_start();
header('Content-Type: application/json; charset=utf-8');
header('X-Content-Type-Options: nosniff');
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
require_once __DIR__ . '/../core.php';
require_once __DIR__ . '/../lsky.php';
$cfg = loadImgJson();
success([
'gh_enabled' => !empty($cfg['gh_enabled']),
'gh_repo' => isset($cfg['gh_repo']) ? $cfg['gh_repo'] : '',
], 'ok');