Skip to content

Commit fb7583a

Browse files
committed
feat(projects): does the configuration support automatic updates.
1 parent fbe7ddb commit fb7583a

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ VITE_SOURCE_MAP=N
4949
# Used to differentiate storage across different domains
5050
VITE_STORAGE_PREFIX=SOY-REACT_
5151

52+
# used to control whether the program automatically detects updates
53+
VITE_AUTOMATICALLY_DETECT_UPDATE=Y
54+
5255
# backend service base url, test environment
5356
VITE_SERVICE_BASE_URL=https://mock.apifox.cn/m1/3109515-0-default
5457

src/plugins/app.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import { Button } from 'antd';
33
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/types/env.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,7 @@ declare namespace Env {
105105
readonly VITE_ICONIFY_URL?: string;
106106
/** Used to differentiate storage across different domains */
107107
readonly VITE_STORAGE_PREFIX?: string;
108+
/** Whether to automatically detect updates after configuring application packaging */
109+
readonly VITE_AUTOMATICALLY_DETECT_UPDATE?: CommonType.YesOrNo;
108110
}
109111
}

0 commit comments

Comments
 (0)