feat: add docs build action
This commit is contained in:
@@ -22,8 +22,6 @@ import {
|
||||
|
||||
const { refreshSettings } = useSiteSettings()
|
||||
|
||||
const baseUrl = (window as any).__BASE_URL__ || ''
|
||||
|
||||
const form = ref<SiteSettings>({
|
||||
title: '',
|
||||
subtitle: '',
|
||||
@@ -113,11 +111,7 @@ async function copyOpenapiToken() {
|
||||
}
|
||||
|
||||
function openSwaggerDocs() {
|
||||
if (!form.value.openapi_enabled) {
|
||||
toast.error('必须先开启 OpenAPI 才能查看接口文档页面')
|
||||
return
|
||||
}
|
||||
window.open(`${baseUrl}/openapi/index.html`, '_blank')
|
||||
window.open('https://engigu.github.io/baihu-panel/guide/api.html', '_blank')
|
||||
}
|
||||
|
||||
|
||||
@@ -245,7 +239,8 @@ onMounted(loadSettings)
|
||||
<div class="flex items-center gap-2">
|
||||
<h3 class="text-lg font-medium text-foreground whitespace-nowrap">OpenAPI Token</h3>
|
||||
<Badge variant="secondary"
|
||||
class="font-normal text-xs bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20 whitespace-nowrap">推荐方式</Badge>
|
||||
class="font-normal text-xs bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20 whitespace-nowrap">
|
||||
推荐方式</Badge>
|
||||
</div>
|
||||
<div class="flex items-center justify-between sm:justify-end w-full sm:w-auto gap-4">
|
||||
<a href="#" @click.prevent="openSwaggerDocs"
|
||||
@@ -261,7 +256,8 @@ onMounted(loadSettings)
|
||||
</div>
|
||||
<p class="text-sm text-muted-foreground mb-4">开启全局 OpenAPI 直接访问能力,配置后可通过请求头 <code
|
||||
class="bg-muted px-1.5 py-0.5 rounded text-xs select-all font-sans">Authorization: Bearer <在此生成的Token></code>
|
||||
以第三方身份调用系统的所有接口,请妥善保管 Token 并设置合理的有效期。<span class="text-amber-600 dark:text-amber-500 font-medium ml-1">注意:必须先开启本功能才能查看接口文档页面和对接调用。</span></p>
|
||||
以第三方身份调用系统的所有接口,请妥善保管 Token 并设置合理的有效期。<span
|
||||
class="text-amber-600 dark:text-amber-500 font-medium ml-1">注意:必须先开启本功能才能查看接口文档页面和对接调用。</span></p>
|
||||
|
||||
<div class="grid grid-cols-1 sm:grid-cols-4 items-center gap-2 sm:gap-4 mb-4">
|
||||
<Label class="sm:text-right text-muted-foreground">Token 密钥</Label>
|
||||
|
||||
Reference in New Issue
Block a user