diff --git a/build/start-my.ico b/build/start-my.ico new file mode 100644 index 0000000..2765b92 Binary files /dev/null and b/build/start-my.ico differ diff --git a/config/my.json b/config/my.json new file mode 100644 index 0000000..b30b329 --- /dev/null +++ b/config/my.json @@ -0,0 +1,57 @@ +{ + "appId": "agora.io.ElectronApiExample", + "asar": true, + "asarUnpack": [ + "node_modules/agora-electron-sdk" + ], + "buildDependenciesFromSource": true, + "compression": "normal", + "productName": "四川绵阳教研平台", + "publish": [ + { + "provider": "generic", + "url": "https://meeting-api.23544.com/meeting/my" + } + ], + "files": [ + "!*.log" + ], + "win": { + "icon": "build/start-my.ico", + "requestedExecutionLevel": "highestAvailable", + "target": [ + { + "target": "nsis", + "arch": [ + "ia32" + ] + } + ] + }, + "directories": { + "output": "electron" + }, + "extraResources": [ + { + "from": "src/assets/virtualBackground", + "to": "images", + "filter": [ + "**/*" + ] + } + ], + "nsis": { + "oneClick": false, + "installerIcon": "build/start-my.ico", + "uninstallerIcon": "build/start-my.ico", + "installerHeaderIcon": "build/start-my.ico", + "allowToChangeInstallationDirectory": true, + "createDesktopShortcut": true, + "createStartMenuShortcut": true, + "deleteAppDataOnUninstall": true, + "shortcutName": "四川绵阳教研平台", + "allowElevation": true, + "perMachine": true, + "include": "build/install.nsh" + } +} \ No newline at end of file diff --git a/main.js b/main.js index b044a2f..0654f4b 100644 --- a/main.js +++ b/main.js @@ -28,8 +28,8 @@ let isMaximized = false; let regKey; let connection = null; let startNumber = 0; -let env = 'development'; //development production xy xatyz -let buildStatus = false; //true 打包开发版本 false 本地开发 +let env = 'my'; //development production xy xatyz my +let buildStatus = true; //true 打包开发版本 false 本地开发 powerSaveBlocker.start('prevent-display-sleep') class AppWindow extends BrowserWindow { @@ -72,7 +72,13 @@ let tray; // 检查网络状态 function checkNetworkStatus() { if (!net.isOnline()) { - dialog.showErrorBox(`${env === 'xy' ? '湖北襄阳四中教研平台' : env === 'xatyz' ? '西安铁一中教研平台' : '智汇享'}-网络连接错误', '当前无网络连接,请检查您的网络设置。`); + const titleMap = { + xy: '湖北襄阳四中教研平台', + xatyz: '西安铁一中教研平台', + my: '四川绵阳教研平台' + }; + const title = `${titleMap[env] || '智汇享'}-网络连接错误`; + dialog.showErrorBox(title, '当前无网络连接,请检查您的网络设置。'); app.quit(); return false; } diff --git a/package.json b/package.json index 77e72aa..5e081e2 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "build:dev": "vite build & node build.js & electron-builder -w --config=./config/development.json", "build:prod": "vite build & node build.js & electron-builder -w --config=./config/production.json", "build:xy": "vite build & node build.js & electron-builder -w --config=./config/xy.json", - "build:xatyz": "vite build & node build.js & electron-builder -w --config=./config/xatyz.json" + "build:xatyz": "vite build & node build.js & electron-builder -w --config=./config/xatyz.json", + "build:my": "vite build & node build.js & electron-builder -w --config=./config/my.json" }, "agora_electron": { "platform": "win32", diff --git a/src/assets/icon62.png b/src/assets/icon62.png new file mode 100644 index 0000000..e4bb07d Binary files /dev/null and b/src/assets/icon62.png differ diff --git a/src/assets/icon63.png b/src/assets/icon63.png new file mode 100644 index 0000000..ff8470f Binary files /dev/null and b/src/assets/icon63.png differ diff --git a/src/page/Login/index.tsx b/src/page/Login/index.tsx index f4fc0b3..11634ef 100644 --- a/src/page/Login/index.tsx +++ b/src/page/Login/index.tsx @@ -213,7 +213,23 @@ const Login: React.FC = () => { <>
- {env ? : null} + {env && ( + { + switch (env) { + case 'xy': + return ImageUrl.icon53 + case 'xatyz': + return ImageUrl.icon58 + case 'my': + return ImageUrl.icon63 + default: + return ImageUrl.icon1 + } + })()} + alt="" + /> + )}
diff --git a/src/utils/package/imageUrl.ts b/src/utils/package/imageUrl.ts index 95aad5d..bd8a33d 100644 --- a/src/utils/package/imageUrl.ts +++ b/src/utils/package/imageUrl.ts @@ -93,6 +93,8 @@ import icon60 from '@/assets/icon60.png' import icon61 from '@/assets/icon61.png' import icon60Active from '@/assets/icon60-active.png' import icon61Active from '@/assets/icon61-active.png' +import icon62 from '@/assets/icon62.png' +import icon63 from '@/assets/icon63.png' export default { loading, icon, @@ -189,4 +191,6 @@ export default { icon61, icon60Active, icon61Active, + icon62, + icon63, } \ No newline at end of file diff --git a/src/utils/package/public.ts b/src/utils/package/public.ts index 1442fd0..7140be2 100644 --- a/src/utils/package/public.ts +++ b/src/utils/package/public.ts @@ -64,6 +64,8 @@ export const getUpdateUrl = (env: string) => { return 'https://meeting-api.23544.com/meeting/xysz' case 'xatyz': return 'https://meeting-api.23544.com/meeting/xatyz' + case 'my': + return 'https://meeting-api.23544.com/meeting/my' case 'development': return 'http://192.168.2.9:8827' default: @@ -80,6 +82,9 @@ export const getTitle = async () => { case 'xatyz': str = '西安铁一中教研平台' break; + case 'my': + str = '四川绵阳教研平台' + break; case 'development': str = '智汇享' break; diff --git a/src/utils/package/update.js b/src/utils/package/update.js index f1ec6c3..081412d 100644 --- a/src/utils/package/update.js +++ b/src/utils/package/update.js @@ -5,6 +5,8 @@ module.exports = { return 'https://meeting-api.23544.com/meeting/xysz' case 'xatyz': return 'https://meeting-api.23544.com/meeting/xatyz' + case 'my': + return 'https://meeting-api.23544.com/meeting/my' case 'development': return 'http://192.168.2.9:8827' default: @@ -17,6 +19,8 @@ module.exports = { return '湖北襄阳四中教研平台' case 'xatyz': return '西安铁一中教研平台' + case 'my': + return '四川绵阳教研平台' case 'development': return '智汇享' default: @@ -29,6 +33,8 @@ module.exports = { return 'icon54' case 'xatyz': return 'icon59' + case 'my': + return 'icon62' case 'development': return 'icon' default: