2023-02-11 00:44:00 +08:00
|
|
|
<template>
|
2023-04-05 20:13:35 +08:00
|
|
|
<doc-alert title="接口文档" url="https://doc.iocoder.cn/api-doc/" />
|
|
|
|
|
2023-02-11 00:44:00 +08:00
|
|
|
<ContentWrap>
|
|
|
|
<IFrame :src="src" />
|
|
|
|
</ContentWrap>
|
|
|
|
</template>
|
2023-04-08 11:48:37 +08:00
|
|
|
<script setup lang="ts" name="InfraSwagger">
|
2023-04-07 23:26:09 +08:00
|
|
|
import * as ConfigApi from '@/api/infra/config'
|
|
|
|
|
|
|
|
const loading = ref(true) // 是否加载中
|
|
|
|
const src = ref(import.meta.env.VITE_BASE_URL + '/doc.html') // Knife4j UI
|
|
|
|
// const src = ref(import.meta.env.VITE_BASE_URL + '/swagger-ui') // Swagger UI
|
|
|
|
|
|
|
|
/** 初始化 */
|
|
|
|
onMounted(async () => {
|
|
|
|
try {
|
|
|
|
const data = await ConfigApi.getConfigKey('url.swagger')
|
|
|
|
if (data && data.length > 0) {
|
|
|
|
src.value = data
|
|
|
|
}
|
|
|
|
} finally {
|
|
|
|
loading.value = false
|
|
|
|
}
|
|
|
|
})
|
2023-02-11 00:44:00 +08:00
|
|
|
</script>
|