feat(projects): does the configuration support automatic updates. close#612 (#617)

This commit is contained in:
青菜白玉汤 2024-09-03 16:52:38 +08:00 committed by GitHub
parent 9c012c7d13
commit 4c9f4e09b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

3
.env
View File

@ -46,3 +46,6 @@ VITE_SOURCE_MAP=N
# Used to differentiate storage across different domains
VITE_STORAGE_PREFIX=SOY_
# used to control whether the program automatically detects updates
VITE_AUTOMATICALLY_DETECT_UPDATE=Y

View File

@ -1,8 +1,12 @@
import { h } from 'vue';
import { NButton } from 'naive-ui';
import { $t } from '../locales';
import { $t } from '@/locales';
export function setupAppVersionNotification() {
const canAutoUpdateApp = import.meta.env.VITE_AUTOMATICALLY_DETECT_UPDATE === 'Y';
if (!canAutoUpdateApp) return;
let isShow = false;
document.addEventListener('visibilitychange', async () => {

View File

@ -103,6 +103,8 @@ declare namespace Env {
readonly VITE_ICONIFY_URL?: string;
/** Used to differentiate storage across different domains */
readonly VITE_STORAGE_PREFIX?: string;
/** Whether to automatically detect updates after configuring application packaging */
readonly VITE_AUTOMATICALLY_DETECT_UPDATE?: CommonType.YesOrNo;
}
}