fix build
This commit is contained in:
@@ -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配置
|
||||
|
||||
Reference in New Issue
Block a user