You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

73 lines
2.7 KiB

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GoFaster API 文档</title>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui.css" />
<style>
html {
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*, *:before, *:after {
box-sizing: inherit;
}
body {
margin:0;
background: #fafafa;
}
.swagger-ui .topbar {
background-color: #2c3e50;
}
.swagger-ui .info .title {
color: #2c3e50;
}
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui-bundle.js"></script>
<script src="https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui-standalone-preset.js"></script>
<script>
window.onload = function() {
const ui = SwaggerUIBundle({
url: '/swagger/doc.json',
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout",
validatorUrl: null,
onComplete: function() {
console.log('Swagger UI loaded successfully');
// 确保Authorize按钮显示
setTimeout(function() {
const authorizeBtn = document.querySelector('.authorize');
if (authorizeBtn) {
console.log('Authorize button found');
} else {
console.log('Authorize button not found, checking security definitions...');
// 检查是否有安全定义
fetch('/swagger/doc.json')
.then(response => response.json())
.then(data => {
console.log('Security definitions:', data.securityDefinitions);
if (data.securityDefinitions) {
console.log('Security definitions exist, Authorize button should be visible');
}
});
}
}, 1000);
}
});
};
</script>
</body>
</html>