// 文档页面 —— Swagger UI(/docs)与 ReDoc(/redoc),静态 HTML + CDN 资源 const SWAGGER_CDN = 'https://unpkg.com/swagger-ui-dist@5/swagger-ui.css' const SWAGGER_BUNDLE_CDN = 'https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js' const REDOC_CDN = 'https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js' const htmlShell = (title, body) => ` ${title} ${body.head} ${body.content} ` export const swaggerHtml = ({ title, specUrl = '/openapi.json' }) => htmlShell(title, { head: ` `, content: `
`, }) export const redocHtml = ({ title, specUrl = '/openapi.json' }) => htmlShell(`${title} (ReDoc)`, { head: ` `, content: ` `, })