fix build

This commit is contained in:
2025-03-26 21:50:04 +08:00
parent 7a03396cdd
commit 4ad505cda1
5 changed files with 51 additions and 19 deletions

View File

@@ -2,12 +2,23 @@
import { useEffect } from 'react';
import SwaggerUI from 'swagger-ui-react';
import 'swagger-ui-react/swagger-ui.css';
export default function SwaggerPage() {
useEffect(() => {
// 设置页面标题
document.title = 'API Documentation - ShortURL Analytics';
// 动态添加Swagger UI CSS
const link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'https://unpkg.com/swagger-ui-dist@5.20.1/swagger-ui.css';
document.head.appendChild(link);
// 清理函数
return () => {
document.head.removeChild(link);
};
}, []);
// Swagger配置