From 06a2e6e4ac644a9b91e967b9ba655ddca0da778c Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Thu, 27 Feb 2025 10:28:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/package/public.ts | 6 +++++- src/utils/package/update.js | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/utils/package/public.ts b/src/utils/package/public.ts index 61dc529..4863bc8 100644 --- a/src/utils/package/public.ts +++ b/src/utils/package/public.ts @@ -62,6 +62,8 @@ export const getUpdateUrl = (env: string) => { switch (env) { case 'xy': return 'https://meeting-api.23544.com/meeting/xysz' + case 'development': + return 'http://192.168.2.9:8827' default: return 'https://meeting-api.23544.com/meeting/update' } @@ -70,6 +72,8 @@ export const getTitle = (env: string) => { switch (env) { case 'xy': return '湖北襄阳四中教研平台' + case 'development': + return '智汇享' default: return '智汇享' } @@ -91,7 +95,7 @@ export const compareVersions = (version1: string, version2: string): number => { } export const isVersion = (callBack: Function) => { - axios.get(import.meta.env.VITE_ENV !== 'development' ? 'https://meeting-api.23544.com/meeting/update' : 'http://192.168.2.9:8827/latest.yml').then(res => { + axios.get(`${getUpdateUrl(import.meta.env.VITE_ENV)}/latest.yml`).then(res => { if (res.status === 200 && res.data) { const data = yaml.load(res.data); // 解析 YAML 内容 window.electron.getVersion().then(req => { diff --git a/src/utils/package/update.js b/src/utils/package/update.js index c03486b..4e10c9a 100644 --- a/src/utils/package/update.js +++ b/src/utils/package/update.js @@ -3,6 +3,8 @@ module.exports = { switch (env) { case 'xy': return 'https://meeting-api.23544.com/meeting/xysz' + case 'development': + return 'http://192.168.2.9:8827' default: return 'https://meeting-api.23544.com/meeting/update' } @@ -11,6 +13,8 @@ module.exports = { switch (env) { case 'xy': return '湖北襄阳四中教研平台' + case 'development': + return '智汇享' default: return '智汇享' } @@ -19,6 +23,8 @@ module.exports = { switch (env) { case 'xy': return 'icon54' + case 'development': + return 'icon' default: return 'icon' }