fix: 去除API文档重复按钮
This commit is contained in:
@@ -587,3 +587,9 @@
|
||||
- The per-row operation dropdown now keeps edit, enable/disable, regenerate, and delete actions; copying is surfaced beside the Token value for faster repeated use.
|
||||
- Build verification: `npm run build` passed with only the existing Vite large chunk warning.
|
||||
- Follow-up UI adjustment: the eye/copy buttons now sit immediately after the Token text instead of being pushed to the far right, and Token rows show `created_at` in the metadata area.
|
||||
|
||||
## 2026-06-01: API documentation toolbar cleanup
|
||||
|
||||
- `frontend/src/components/ApiDocs.vue` no longer registers a page-header `copy sample` action, avoiding duplicate `复制传参示例` buttons on the API documentation page.
|
||||
- The API documentation card still keeps its local toolbar actions: `复制传参示例` and `OpenAPI JSON`.
|
||||
- Verification performed: `npm run build` passed, and generated frontend build output was removed after verification.
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user