From f9359ed0f9c84d33f7d5753bdc0c3a758d3a66fe Mon Sep 17 00:00:00 2001 From: zhangjian10 <315626713@qq.com> Date: Fri, 20 Sep 2024 22:37:30 +0800 Subject: [PATCH] fix: update fetch URL to use BASE_URL for version tag retrieval (#4448) * fix: update fetch URL to use BASE_URL for version tag retrieval * feat: add configurable update check URL for better flexibility --------- Co-authored-by: zj <1018zhangjian@gmail.com> --- .../layouts/src/widgets/check-updates/check-updates.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/effects/layouts/src/widgets/check-updates/check-updates.vue b/packages/effects/layouts/src/widgets/check-updates/check-updates.vue index 2f366e44..5e6d7e97 100644 --- a/packages/effects/layouts/src/widgets/check-updates/check-updates.vue +++ b/packages/effects/layouts/src/widgets/check-updates/check-updates.vue @@ -7,12 +7,15 @@ import { ToastAction, useToast } from '@vben-core/shadcn-ui'; interface Props { // 轮训时间,分钟 checkUpdatesInterval?: number; + // 检查更新的地址 + checkUpdateUrl?: string; } defineOptions({ name: 'CheckUpdates' }); const props = withDefaults(defineProps(), { checkUpdatesInterval: 1, + checkUpdateUrl: import.meta.env.BASE_URL || '/', }); const lastVersionTag = ref(''); @@ -28,7 +31,7 @@ async function getVersionTag() { ) { return null; } - const response = await fetch('/', { + const response = await fetch(props.checkUpdateUrl, { cache: 'no-cache', method: 'HEAD', });