Skip to content

Commit ffe4cef

Browse files
committed
feat(projects): does the configuration support automatic updates
1 parent 5a020dd commit ffe4cef

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ VITE_STATIC_SUPER_ROLE=R_SUPER
4343

4444
# Used to differentiate storage across different domains
4545
VITE_STORAGE_PREFIX=SOY_
46+
47+
# used to control whether the program automatically detects updates
48+
VITE_AUTOMATICALLY_DETECT_UPDATE=Y

src/plugins/app.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import { h } from 'vue';
22
import { Button } from 'ant-design-vue';
3-
import { $t } from '../locales';
3+
import { $t } from '@/locales';
44

55
export function setupAppVersionNotification() {
6+
const canAutoUpdateApp = import.meta.env.VITE_AUTOMATICALLY_DETECT_UPDATE === 'Y';
7+
8+
if (!canAutoUpdateApp) return;
9+
610
let isShow = false;
711

812
document.addEventListener('visibilitychange', async () => {

src/typings/env.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ declare namespace Env {
103103
readonly VITE_ICONIFY_URL?: string;
104104
/** Used to differentiate storage across different domains */
105105
readonly VITE_STORAGE_PREFIX?: string;
106+
/** Whether to automatically detect updates after configuring application packaging */
107+
readonly VITE_AUTOMATICALLY_DETECT_UPDATE?: CommonType.YesOrNo;
106108
}
107109
}
108110

0 commit comments

Comments
 (0)