fix: 去除API文档重复按钮

This commit is contained in:
2026-06-01 11:59:27 +08:00
parent c9432a3c65
commit a35ff33e36
2 changed files with 7 additions and 11 deletions
+1 -11
View File
@@ -20,13 +20,12 @@
</template>
<script setup lang="ts">
import { nextTick, onBeforeUnmount, onMounted, ref } from 'vue';
import { nextTick, onMounted, ref } from 'vue';
import { useMessage } from 'naive-ui';
import SwaggerUIBundle from 'swagger-ui-dist/swagger-ui-bundle.js';
import 'swagger-ui-dist/swagger-ui.css';
import { apiUrl, getApiBaseUrl, getToken } from '../api/client';
import { resetPageHeader, setPageHeader } from '../composables/pageHeader';
type SwaggerSystem = {
getSystem?: () => {
@@ -47,19 +46,10 @@ const openApiUrl = apiUrl('/api/openapi.json');
let swaggerUi: SwaggerSystem | undefined;
onMounted(async () => {
setPageHeader({
actions: [
{ key: 'copy-api-token-header', label: '复制传参示例', onClick: copyHeaderSample }
]
});
await nextTick();
initSwagger();
});
onBeforeUnmount(() => {
resetPageHeader();
});
function initSwagger() {
if (!swaggerHost.value) return;