feat: 迁移前端资源文件并重构项目结构

refactor: 优化前端代码结构和资源管理

style: 调整前端代码格式和样式

chore: 更新.gitignore和构建配置

fix: 修复前端资源路径和引用问题

docs: 更新前端文档和注释

perf: 优化前端性能和加载速度

test: 更新前端测试用例

build: 调整前端构建配置

ci: 更新CI/CD配置
This commit is contained in:
zhangtao
2026-05-09 00:46:43 +08:00
parent 1bd125d99b
commit bf81480ada
967 changed files with 21018 additions and 83019 deletions
@@ -0,0 +1,48 @@
<!-- 接口文档 -->
<template>
<div class="box-border w-full h-full" v-loading="isLoading">
<iframe
ref="iframeRef"
:src="iframeUrl"
frameborder="0"
class="w-full h-full min-h-[calc(100vh-120px)] border-none"
@load="handleIframeLoad"
></iframe>
</div>
</template>
<script setup lang="ts">
import { IframeRouteManager } from "@/router";
defineOptions({ name: "Docs", inheritAttrs: false });
const url = ref(import.meta.env.VITE_APP_BASE_API + "/docs");
const route = useRoute();
const isLoading = ref(true);
const iframeUrl = ref(url);
const iframeRef = ref<HTMLIFrameElement | null>(null);
onBeforeUnmount(() => {
window.onresize = null;
});
/**
* 初始化 iframe URL
* 从路由配置中获取对应的外部链接地址
*/
onMounted(() => {
const iframeRoute = IframeRouteManager.getInstance().findByPath(route.path);
if (iframeRoute?.meta) {
iframeUrl.value = iframeRoute.meta.link || "";
}
});
/**
* 处理 iframe 加载完成事件
* 隐藏加载状态
*/
const handleIframeLoad = (): void => {
isLoading.value = false;
};
</script>
@@ -0,0 +1,48 @@
<!-- 接口文档 -->
<template>
<div class="box-border w-full h-full" v-loading="isLoading">
<iframe
ref="iframeRef"
:src="iframeUrl"
frameborder="0"
class="w-full h-full min-h-[calc(100vh-120px)] border-none"
@load="handleIframeLoad"
></iframe>
</div>
</template>
<script setup lang="ts">
import { IframeRouteManager } from "@/router";
defineOptions({ name: "Ljdoc", inheritAttrs: false });
const url = ref(import.meta.env.VITE_APP_BASE_API + "/ljdoc");
const route = useRoute();
const isLoading = ref(true);
const iframeUrl = ref(url);
const iframeRef = ref<HTMLIFrameElement | null>(null);
onBeforeUnmount(() => {
window.onresize = null;
});
/**
* 初始化 iframe URL
* 从路由配置中获取对应的外部链接地址
*/
onMounted(() => {
const iframeRoute = IframeRouteManager.getInstance().findByPath(route.path);
if (iframeRoute?.meta) {
iframeUrl.value = iframeRoute.meta.link || "";
}
});
/**
* 处理 iframe 加载完成事件
* 隐藏加载状态
*/
const handleIframeLoad = (): void => {
isLoading.value = false;
};
</script>
@@ -0,0 +1,48 @@
<!-- 接口文档 -->
<template>
<div class="box-border w-full h-full" v-loading="isLoading">
<iframe
ref="iframeRef"
:src="iframeUrl"
frameborder="0"
class="w-full h-full min-h-[calc(100vh-120px)] border-none"
@load="handleIframeLoad"
></iframe>
</div>
</template>
<script setup lang="ts">
import { IframeRouteManager } from "@/router";
defineOptions({ name: "Redoc", inheritAttrs: false });
const url = ref(import.meta.env.VITE_APP_BASE_API + "/redoc");
const route = useRoute();
const isLoading = ref(true);
const iframeUrl = ref(url);
const iframeRef = ref<HTMLIFrameElement | null>(null);
onBeforeUnmount(() => {
window.onresize = null;
});
/**
* 初始化 iframe URL
* 从路由配置中获取对应的外部链接地址
*/
onMounted(() => {
const iframeRoute = IframeRouteManager.getInstance().findByPath(route.path);
if (iframeRoute?.meta) {
iframeUrl.value = iframeRoute.meta.link || "";
}
});
/**
* 处理 iframe 加载完成事件
* 隐藏加载状态
*/
const handleIframeLoad = (): void => {
isLoading.value = false;
};
</script>