diff --git a/composables/useSystem.ts b/composables/useSystem.ts index 404e15b..468362d 100644 --- a/composables/useSystem.ts +++ b/composables/useSystem.ts @@ -20,5 +20,9 @@ export const useSystem = () => { async getSystemMetrics() { return await $api.get("/metrics") }, + // 获取license + async getLicense() { + return await $api.get("/license") + }, } } diff --git a/config/navs.ts b/config/navs.ts index 22be9f5..4ee8b67 100644 --- a/config/navs.ts +++ b/config/navs.ts @@ -61,12 +61,6 @@ export default [ to: '/license', icon: 'ri:copyright-line' }, - { - label:'企业授权', - // to: 'https://github.com/rustfs/rustfs?tab=Apache-2.0-1-ov-file#readme', - to: '/license2', - icon: 'ri:copyright-line' - }, { label: '文档', to: 'https://rustfs.com/docs/', diff --git a/nuxt.config.ts b/nuxt.config.ts index 81d3a13..485636c 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -70,7 +70,7 @@ export default defineNuxtConfig({ // 授权信息 license: { "name": "Apache-2.0", - "url": "https://www.apache.org/licenses/LICENSE-2.0" + "expired": "" } } }, diff --git a/pages/license/article.vue b/pages/license/article.vue new file mode 100644 index 0000000..27b6bf0 --- /dev/null +++ b/pages/license/article.vue @@ -0,0 +1,159 @@ + + + + + \ No newline at end of file diff --git a/pages/license2/chart-1.vue b/pages/license/chart-1.vue similarity index 100% rename from pages/license2/chart-1.vue rename to pages/license/chart-1.vue diff --git a/pages/license2/chart-2.vue b/pages/license/chart-2.vue similarity index 100% rename from pages/license2/chart-2.vue rename to pages/license/chart-2.vue diff --git a/pages/license/index.vue b/pages/license/index.vue index 27b6bf0..adc3b12 100644 --- a/pages/license/index.vue +++ b/pages/license/index.vue @@ -1,159 +1,199 @@ - - \ No newline at end of file diff --git a/pages/license2/index.vue b/pages/license2/index.vue deleted file mode 100644 index 49f4a81..0000000 --- a/pages/license2/index.vue +++ /dev/null @@ -1,124 +0,0 @@ - - - - - \ No newline at end of file diff --git a/plugins/01.config.ts b/plugins/01.config.ts index 3c734c8..e3f64dd 100644 --- a/plugins/01.config.ts +++ b/plugins/01.config.ts @@ -9,6 +9,15 @@ export default defineNuxtPlugin({ try { const response = await fetch('/config.json') const remoteConfig = await response.json() + // 获取license + const licenseResponse = await fetch('/license.json') + const licenseConfig = await licenseResponse.json() + if (licenseConfig !== null) { + remoteConfig.license = licenseConfig + } else { + remoteConfig.license = false + } + // 合并 public/runtimeConfig 与 remote 配置,remote 的优先 finalConfig = { ...useRuntimeConfig().public, ...remoteConfig } console.log('加载 public/config.json 成功:', remoteConfig) diff --git a/types/config.d.ts b/types/config.d.ts index f31a564..ac44027 100644 --- a/types/config.d.ts +++ b/types/config.d.ts @@ -16,7 +16,7 @@ export type ReleaseConfig = { export type LicenseConfig = { name: string; - url: string; + expired: string; } export type SessionConfig = { @@ -27,6 +27,6 @@ export interface SiteConfig { api: ApiConfig; s3: S3Config; release: ReleaseConfig; - license: LicenseConfig; + license: LicenseConfig | boolean; session?: SessionConfig; }