index.vue 780 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <div>
  3. <doc-alert title="接口文档" url="https://doc.iocoder.cn/api-doc/" />
  4. <i-frame v-if="!loading" :src="url" />
  5. </div>
  6. </template>
  7. <script>
  8. import iFrame from "@/components/iFrame/index";
  9. import { getConfigKey } from "@/api/infra/config";
  10. export default {
  11. name: "Druid",
  12. components: { iFrame },
  13. data() {
  14. return {
  15. url: process.env.VUE_APP_BASE_API + "/doc.html", // Knife4j UI
  16. // url: process.env.VUE_APP_BASE_API + "/swagger-ui", // Swagger UI
  17. loading: true
  18. };
  19. },
  20. created() {
  21. getConfigKey("url.swagger").then(response => {
  22. if (!response.data || response.data.length === 0) {
  23. return
  24. }
  25. this.url = response.data;
  26. }).finally(() => {
  27. this.loading = false;
  28. })
  29. }
  30. };
  31. </script>