diff --git a/soul-admin/dist/index.html b/soul-admin/dist/index.html index d03c904..af0d6fb 100644 --- a/soul-admin/dist/index.html +++ b/soul-admin/dist/index.html @@ -31,6 +31,13 @@ .si-api pre{background:#0a0e17;border:1px solid #1e293b;border-radius:6px;padding:12px; overflow-x:auto;margin:6px 0 14px;font-size:12px;color:#2dd4a8;white-space:pre-wrap} .si-api h4{color:#e0e6ed;font-size:13px;margin:16px 0 4px;font-family:sans-serif} +.si-token-box{background:#0a0e17;border:1px solid #2dd4a8;border-radius:8px;padding:14px;margin-bottom:20px} +.si-token-box .si-token-row{display:flex;gap:8px;align-items:center;margin-top:8px} +.si-token-box input{flex:1;padding:8px 10px;background:#111827;border:1px solid #1e293b;border-radius:6px;color:#2dd4a8;font-size:12px;font-family:monospace} +.si-token-btn{padding:8px 16px;border-radius:6px;font-size:13px;cursor:pointer;border:none;background:#2dd4a8;color:#0a0e17;font-weight:600} +.si-token-btn:hover{background:#22b896} +.si-token-btn.copy{background:#1e293b;color:#e0e6ed} +.si-token-btn.copy:hover{background:#334155} .si-toast{position:fixed;top:16px;right:16px;padding:10px 18px;border-radius:6px; font-size:13px;z-index:99999;animation:siFade .25s} .si-toast.ok{background:#065f46;color:#6ee7b7} @@ -39,7 +46,7 @@ `; document.head.appendChild(CSS); - var API='https://souldev.quwanzhi.com'; + var API=(window.location.hostname||'').indexOf('souladmin')>=0?'':'https://souldev.quwanzhi.com'; var token=localStorage.getItem('admin_token')||''; function toast(m,ok){var t=document.createElement('div');t.className='si-toast '+(ok!==false?'ok':'err'); @@ -142,6 +149,10 @@ apiP.className='si-panel';apiP.id='si-apidoc';apiP.style.display='none'; apiP.innerHTML='
' +'

内容管理 API 接口文档

' + +'
生成 TOKEN — 用于上传新章节、删除等操作
' + +'
' + +'' + +'
' +'

基础域名: https://soulapi.quwanzhi.com (正式) / https://souldev.quwanzhi.com (开发)

' +'

1. 获取所有章节 (无需认证)

GET /api/book/all-chapters\n\ncurl https://soulapi.quwanzhi.com/api/book/all-chapters
' +'

2. 获取单章内容

GET /api/book/chapter/:id\n\ncurl https://soulapi.quwanzhi.com/api/book/chapter/1.1
' @@ -153,6 +164,22 @@ +'
'; insertTarget.parentElement.insertBefore(apiP,insertTarget); + document.getElementById('si-gen-token').onclick=function(){ + var inp=document.getElementById('si-token-input'); + inp.value='获取中...'; + doLogin().then(function(ok){ + if(ok&&token){inp.value=token;toast('TOKEN 已生成,可复制使用')} + else{inp.value='';toast('获取失败',false)} + }); + }; + document.getElementById('si-copy-token').onclick=function(){ + var inp=document.getElementById('si-token-input'); + if(!inp.value||inp.value==='获取中...'){toast('请先生成 TOKEN',false);return} + inp.select();document.execCommand('copy'); + toast('已复制到剪贴板'); + }; + document.getElementById('si-token-input').onclick=function(){this.select()}; + // === 3. 给每个章节添加删除按钮 === addDelBtns(); new MutationObserver(function(){addDelBtns()}).observe(document.getElementById('root'),{childList:true,subtree:true});