chore: 将后端移动到 api/ 目录,准备合并为单仓库

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-26 16:01:25 +08:00
1 parent e172ffc0b3
commit 0591eda56f
244 files changed

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
/**JS file for handling the SwaggerUIBundle and avoid inline script */
const csrfSettings = document.querySelector("body").dataset
const configJson = document.getElementById("swagger-settings").textContent;
const configObject = JSON.parse(configJson);
configObject.dom_id = "#swagger-ui";
configObject.presets = [
SwaggerUIBundle.presets.apis,
SwaggerUIBundle.SwaggerUIStandalonePreset
];
if (csrfSettings.apiCsrf && csrfSettings.csrfToken) {
configObject.requestInterceptor = (req) => {
req.headers['X-CSRFToken'] = csrfSettings.csrfToken
return req;
};
};
// {% if add_csrf %}
// configObject.requestInterceptor = (req) => {
// req.headers['X-CSRFToken'] = "{{csrf_token}}";
// return req;
// };
// {% endif %}
const ui = SwaggerUIBundle(configObject);
// SwaggerUIBundle({
// url: swaggerUi.dataset.openapiUrl,
// dom_id: '#swagger-ui',
// presets: [
// SwaggerUIBundle.presets.apis,
// SwaggerUIBundle.SwaggerUIStandalonePreset
// ],
// layout: "BaseLayout",
// requestInterceptor: (req) => {
// if (swaggerUi.dataset.apiCsrf && swaggerUi.dataset.csrfToken) {
// req.headers['X-CSRFToken'] = swaggerUi.dataset.csrfToken
// }
// return req;
// },
// deepLinking: true
// })