Add files via upload

This commit is contained in:
公明
2026-07-10 18:45:07 +08:00
committed by GitHub
parent bc3246d157
commit 3bfa846db1
4 changed files with 7 additions and 19 deletions
+3 -6
View File
@@ -96,12 +96,9 @@ async function loadToken() {
// 加载OpenAPI规范
async function loadAPISpec() {
try {
let url = '/api/openapi/spec';
if (currentToken) {
url += '?token=' + encodeURIComponent(currentToken);
}
const response = await fetch(url);
const url = '/api/openapi/spec';
const headers = currentToken ? { 'Authorization': `Bearer ${currentToken}` } : {};
const response = await fetch(url, { headers });
if (!response.ok) {
if (response.status === 401) {
showError(_t('apiDocs.errorLoginRequired'));