Browse Source

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>
pull/4451/head
zhangjian10 1 year ago
committed by GitHub
parent
commit
f9359ed0f9
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 5
      packages/effects/layouts/src/widgets/check-updates/check-updates.vue

5
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<Props>(), {
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',
});

Loading…
Cancel
Save