Skip to content

Commit 87f6c65

Browse files
committed
更新swagger资源5.32
1 parent 97d2562 commit 87f6c65

2 files changed

Lines changed: 35 additions & 57 deletions

File tree

publish/api_docs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
| 设置swagger资源路径,cdn资源
5353
|--------------------------------------------------------------------------
5454
*/
55-
'prefix_swagger_resources' => 'https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/5.27.1',
55+
'prefix_swagger_resources' => 'https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.32.0',
5656

5757
/*
5858
|--------------------------------------------------------------------------

src/web/swagger.html

Lines changed: 34 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,38 @@
1-
<!-- HTML for static distribution bundle build -->
21
<!DOCTYPE html>
32
<html lang="en">
4-
<head>
5-
<meta charset="UTF-8">
6-
<title>Swagger UI</title>
7-
<link rel="stylesheet" type="text/css" href="{{$path}}/swagger-ui.css" />
8-
<link rel="icon" type="image/png" href="{{$prefixUrl}}/favicon.ico" sizes="32x32" />
9-
<style>
10-
html
11-
{
12-
box-sizing: border-box;
13-
overflow: -moz-scrollbars-vertical;
14-
overflow-y: scroll;
15-
}
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<meta name="description" content="SwaggerUI" />
7+
<title>SwaggerUI</title>
8+
<link rel="stylesheet" href="{{$path}}/swagger-ui.css" />
9+
<link rel="icon" type="image/png" href="{{$prefixUrl}}/favicon.ico" sizes="32x32" />
10+
</head>
11+
<body>
12+
<div id="swagger-ui"></div>
13+
<script src="{{$path}}/swagger-ui-bundle.js" crossorigin></script>
14+
<script src="{{$path}}/swagger-ui-standalone-preset.js" crossorigin></script>
15+
<script>
16+
window.onload = function() {
17+
// Begin Swagger UI call region
18+
const ui = SwaggerUIBundle({
19+
urls: ["{{$urls}}"],
20+
dom_id: '#swagger-ui',
21+
deepLinking: true,
22+
presets: [
23+
SwaggerUIBundle.presets.apis,
24+
SwaggerUIStandalonePreset
25+
],
26+
plugins: [
27+
SwaggerUIBundle.plugins.DownloadUrl
28+
],
29+
layout: "StandaloneLayout",
30+
docExpansion: "none"
31+
});
32+
// End Swagger UI call region
1633

17-
*,
18-
*:before,
19-
*:after
20-
{
21-
box-sizing: inherit;
22-
}
23-
24-
body
25-
{
26-
margin:0;
27-
background: #fafafa;
28-
}
29-
</style>
30-
</head>
31-
32-
<body>
33-
<div id="swagger-ui"></div>
34-
35-
<script src="{{$path}}/swagger-ui-bundle.js" charset="UTF-8"> </script>
36-
<script src="{{$path}}/swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
37-
<script>
38-
window.onload = function() {
39-
// Begin Swagger UI call region
40-
const ui = SwaggerUIBundle({
41-
urls: ["{{$urls}}"],
42-
dom_id: '#swagger-ui',
43-
deepLinking: true,
44-
presets: [
45-
SwaggerUIBundle.presets.apis,
46-
SwaggerUIStandalonePreset
47-
],
48-
plugins: [
49-
SwaggerUIBundle.plugins.DownloadUrl
50-
],
51-
layout: "StandaloneLayout",
52-
docExpansion: "none"
53-
});
54-
// End Swagger UI call region
55-
56-
window.ui = ui;
57-
};
58-
</script>
59-
</body>
34+
window.ui = ui;
35+
};
36+
</script>
37+
</body>
6038
</html>

0 commit comments

Comments
 (0)