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
+6
View File
@@ -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. - 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. - 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. - 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.
+1 -11
View File
@@ -20,13 +20,12 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { nextTick, onBeforeUnmount, onMounted, ref } from 'vue'; import { nextTick, onMounted, ref } from 'vue';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import SwaggerUIBundle from 'swagger-ui-dist/swagger-ui-bundle.js'; import SwaggerUIBundle from 'swagger-ui-dist/swagger-ui-bundle.js';
import 'swagger-ui-dist/swagger-ui.css'; import 'swagger-ui-dist/swagger-ui.css';
import { apiUrl, getApiBaseUrl, getToken } from '../api/client'; import { apiUrl, getApiBaseUrl, getToken } from '../api/client';
import { resetPageHeader, setPageHeader } from '../composables/pageHeader';
type SwaggerSystem = { type SwaggerSystem = {
getSystem?: () => { getSystem?: () => {
@@ -47,19 +46,10 @@ const openApiUrl = apiUrl('/api/openapi.json');
let swaggerUi: SwaggerSystem | undefined; let swaggerUi: SwaggerSystem | undefined;
onMounted(async () => { onMounted(async () => {
setPageHeader({
actions: [
{ key: 'copy-api-token-header', label: '复制传参示例', onClick: copyHeaderSample }
]
});
await nextTick(); await nextTick();
initSwagger(); initSwagger();
}); });
onBeforeUnmount(() => {
resetPageHeader();
});
function initSwagger() { function initSwagger() {
if (!swaggerHost.value) return; if (!swaggerHost.value) return;