diff --git a/.env.yy b/.env.yy new file mode 100644 index 0000000..2f7d3ba --- /dev/null +++ b/.env.yy @@ -0,0 +1,27 @@ +# 页面标题 +VITE_APP_TITLE = 育人酉数平台 + +VITE_APP_ID = 'aix-win-ws-yy' + +# 生产环境配置 +VITE_APP_ENV = 'production' + +# AIx融合数字管理系统/生产环境 +VITE_APP_BASE_API = 'https://prev.ysaix.com:7868/prod-api' + +VITE_APP_DOMAIN = 'prev.ysaix.com' + +VITE_APP_UPLOAD_API = 'https://prev.ysaix.com:7868/prod-api' + +# 是否在打包时开启压缩,支持 gzip 和 brotli +VITE_BUILD_COMPRESS = gzip + +VITE_APP_RES_FILE_PATH = 'https://prev.ysaix.com:7868/src/assets/textbook/booktxt/' + +VITE_APP_BUILD_BASE_PATH = 'https://prev.ysaix.com:7868/' + +# websocket 地址 +VITE_APP_WS_URL = 'wss://prev.ysaix.com:7868' + +# 是否显示开发工具 +VITE_SHOW_DEV_TOOLS = 'false' diff --git a/electron-builder-prod.yml b/electron-builder-prod.yml index 67e3c68..4eea1f2 100644 --- a/electron-builder-prod.yml +++ b/electron-builder-prod.yml @@ -6,6 +6,11 @@ directories: win: executableName: 文枢课堂 icon: resources/logo2.ico + target: + - target: nsis + arch: + - x64 + - ia32 files: - '!**/.vscode/*' - '!src/*' @@ -47,8 +52,8 @@ publish: electronDownload: mirror: https://npmmirror.com/mirrors/electron/ # 额外依赖打包到输出目录 -extraFiles: - - from: ./node_modules/im_electron_sdk/lib/ - to: ./resources - filter: - - '**/*' +#extraFiles: +# - from: ./node_modules/im_electron_sdk/lib/ +# to: ./resources +# filter: +# - '**/*' diff --git a/electron-builder-test.yml b/electron-builder-test.yml index 6159547..dfa1de5 100644 --- a/electron-builder-test.yml +++ b/electron-builder-test.yml @@ -13,6 +13,11 @@ asarUnpack: win: executableName: AIx icon: resources/logo2.ico + target: + - target: nsis + arch: + - x64 + - ia32 nsis: oneClick: false allowToChangeInstallationDirectory: true @@ -46,8 +51,8 @@ publish: electronDownload: mirror: https://npmmirror.com/mirrors/electron/ # 额外依赖打包到输出目录 -extraFiles: - - from: ./node_modules/im_electron_sdk/lib/ - to: ./resources - filter: - - '**/*' +#extraFiles: +# - from: ./node_modules/im_electron_sdk/lib/ +# to: ./resources +# filter: +# - '**/*' diff --git a/electron-builder-yc.yml b/electron-builder-yc.yml index 89158a2..6ed8ad7 100644 --- a/electron-builder-yc.yml +++ b/electron-builder-yc.yml @@ -6,6 +6,11 @@ directories: win: executableName: 永川中小学AI教学系统 icon: resources/yc-logo.png + target: + - target: nsis + arch: + - x64 + - ia32 files: - '!**/.vscode/*' - '!src/*' @@ -47,8 +52,8 @@ publish: electronDownload: mirror: https://npmmirror.com/mirrors/electron/ # 额外依赖打包到输出目录 -extraFiles: - - from: ./node_modules/im_electron_sdk/lib/ - to: ./resources - filter: - - '**/*' +#extraFiles: +# - from: ./node_modules/im_electron_sdk/lib/ +# to: ./resources +# filter: +# - '**/*' diff --git a/electron-builder-yc2.yml b/electron-builder-yc2.yml index 3f9322a..ce77b6d 100644 --- a/electron-builder-yc2.yml +++ b/electron-builder-yc2.yml @@ -6,6 +6,11 @@ directories: win: executableName: 实训教学 icon: resources/yc-logo.png + target: + - target: nsis + arch: + - x64 + - ia32 files: - '!**/.vscode/*' - '!src/*' @@ -47,8 +52,8 @@ publish: electronDownload: mirror: https://npmmirror.com/mirrors/electron/ # 额外依赖打包到输出目录 -extraFiles: - - from: ./node_modules/im_electron_sdk/lib/ - to: ./resources - filter: - - '**/*' +#extraFiles: +# - from: ./node_modules/im_electron_sdk/lib/ +# to: ./resources +# filter: +# - '**/*' diff --git a/electron-builder-yy.yml b/electron-builder-yy.yml new file mode 100644 index 0000000..46a0498 --- /dev/null +++ b/electron-builder-yy.yml @@ -0,0 +1,59 @@ +appId: com.electron.app.yy +productName: 育人酉数平台 +directories: + output: dist + buildResources: build +win: + executableName: 育人酉数平台 + icon: resources/yy-logo.png + target: + - target: nsis + arch: + - x64 + - ia32 +files: + - '!**/.vscode/*' + - '!src/*' + - '!electron.vite.config.{js,ts,mjs,cjs}' + - '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}' + - '!{.env,.env.*,.npmrc,pnpm-lock.yaml}' +asarUnpack: + - resources/** +nsis: + oneClick: false + allowToChangeInstallationDirectory: true + artifactName: ${name}-${version}-setup.${ext} + shortcutName: ${productName} + uninstallDisplayName: ${productName} + createDesktopShortcut: always +mac: + entitlementsInherit: build/entitlements.mac.plist + extendInfo: + - NSCameraUsageDescription: Application requests access to the device's camera. + - NSMicrophoneUsageDescription: Application requests access to the device's microphone. + - NSDocumentsFolderUsageDescription: Application requests access to the user's Documents folder. + - NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder. + notarize: false +dmg: + artifactName: ${name}-${version}.${ext} +linux: + target: + - AppImage + - snap + - deb + maintainer: electronjs.org + category: Utility +appImage: + artifactName: ${name}-${version}.${ext} +npmRebuild: false +publish: + provider: generic + url: https://prev.ysaix.com:7868/src/assets/smarttalkyy/ +electronDownload: + mirror: https://npmmirror.com/mirrors/electron/ +# 额外依赖打包到输出目录 +#extraFiles: +# - from: ./node_modules/im_electron_sdk/lib/ +# to: ./resources +# filter: +# - '**/*' diff --git a/electron-builder.yml b/electron-builder.yml index 3f52b2f..a974581 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -13,6 +13,11 @@ asarUnpack: win: executableName: AIx icon: resources/logo2.ico + target: + - target: nsis + arch: + - x64 + - ia32 nsis: oneClick: false allowToChangeInstallationDirectory: true @@ -46,8 +51,8 @@ publish: electronDownload: mirror: https://npmmirror.com/mirrors/electron/ # 额外依赖打包到输出目录 -extraFiles: - - from: ./node_modules/im_electron_sdk/lib/ - to: ./resources - filter: - - '**/*' +#extraFiles: +# - from: ./node_modules/im_electron_sdk/lib/ +# to: ./resources +# filter: +# - '**/*' diff --git a/package.json b/package.json index fbdbc6d..a5b5a0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aix-win-ws", - "version": "2.5.15", + "version": "2.5.16", "description": "", "main": "./out/main/index.js", "author": "上海交大重庆人工智能研究院", @@ -14,9 +14,11 @@ "build:unpack": "npm run build && electron-builder --dir", "build:dev": "npm run build && electron-builder --win --config ./electron-builder-test.yml", "build:test": "node updatePackageJsonName.js && electron-vite build --mode test && electron-builder --win --config ./electron-builder.yml", - "build": "node updatePackageJsonName.js && electron-vite build --mode production && electron-builder --win --config ./electron-builder-prod.yml", + "build:prod": "node updatePackageJsonName.js && electron-vite build --mode production && electron-builder --win --config ./electron-builder-prod.yml --win", + "build:prod32": "node updatePackageJsonName.js && electron-vite build --mode production && electron-builder --win --config ./electron-builder-prod.yml --win --ia32", "build:yc": "node updatePackageJsonName.js && electron-vite build --mode yc && electron-builder --win --config ./electron-builder-yc.yml", "build:yc2": "node updatePackageJsonName.js && electron-vite build --mode yc2 && electron-builder --win --config ./electron-builder-yc2.yml", + "build:yy": "node updatePackageJsonName.js && electron-vite build --mode yy && electron-builder --win --config ./electron-builder-yy.yml", "build:lt": "electron-vite build --mode lt && electron-builder --win --config ./electron-builder-lt.yml", "build:mac": "electron-vite build --mode production && electron-builder --mac --config ./electron-builder-prod.yml", "build:linux": "npm run build && electron-builder --linux" @@ -42,7 +44,7 @@ "@vue-office/excel": "^1.7.11", "@vue-office/pdf": "^2.0.2", "@vueuse/core": "^10.11.0", - "aix-plugins-aitools": "^1.1.0", + "aix-plugins-aitools": "^1.1.5", "animate.css": "^4.1.1", "circular-json": "^0.5.9", "clipboard": "^2.0.11", @@ -54,14 +56,12 @@ "electron-log": "^5.1.7", "electron-store": "8.0.0", "electron-updater": "^6.1.7", - "element-china-area-data": "^6.1.0", "element-plus": "^2.8.0", "fabric": "^5.3.0", "file-saver": "^2.0.5", "hfmath": "^0.0.2", "html-to-image": "^1.11.11", "html2canvas": "^1.4.1", - "im_electron_sdk": "^8.0.5904", "js-cookie": "^3.0.5", "jsencrypt": "^3.3.2", "jsondiffpatch": "0.6.0", @@ -139,4 +139,4 @@ "vue-tsc": "^1.8.25", "windicss": "^3.5.6" } -} +} \ No newline at end of file diff --git a/resources/yy-logo.png b/resources/yy-logo.png new file mode 100644 index 0000000..d64abf0 Binary files /dev/null and b/resources/yy-logo.png differ diff --git a/src/main/index.js b/src/main/index.js index a430510..5f124d0 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -4,7 +4,7 @@ import { electronApp, optimizer, is } from '@electron-toolkit/utils' import icon from '../../resources/icon.png?asset' import File from './file' import Logger from './logger' // 日志封装 -import chat from './chat' // chat封装 +// import chat from './chat' // chat封装 import Store from './store' // Store封装 import updateInit from './update' @@ -42,12 +42,28 @@ if(!gotTheLock){ } }) } -let logoIco = import.meta.env.MODE==='yc'||import.meta.env.MODE==='yc2'?'../../resources/yc-logo.png':'../../resources/logo2.ico' +let logoIco = "" + +switch (import.meta.env.MODE) { + case 'yc': + logoIco = '../../resources/yc-logo.png' + break + case 'yc2': + logoIco = '../../resources/yc-logo.png' + break + case 'yy': + logoIco = '../../resources/yy-logo.png' + break + default: + logoIco = '../../resources/logo2.ico' + break +} //登录窗口 function createLoginWindow() { if (loginWindow) return loginWindow = new BrowserWindow({ - width: import.meta.env.MODE==='yc'||import.meta.env.MODE==='yc2'?1060:888, + // width: import.meta.env.MODE==='yc'||import.meta.env.MODE==='yc2'?1060:888, + width: 1060, height: 520, show: false, frame: false, @@ -277,14 +293,14 @@ app.on('window-all-closed', () => { // 监听全局事件 function handleAll() { - const chatInstance = chat.initialize() // im-chat 实例 + // const chatInstance = chat.initialize() // im-chat 实例 // 新窗口创建-监听 ipcMain.handle('new-window', (e, data) => { const { id, type } = data const win = BrowserWindow.fromId(id) win.type = type // 绑定独立标识 remote.enable(win.webContents) // 开启远程服务 - chatInstance.enable(win.webContents) // 开启im-chat + // chatInstance.enable(win.webContents) // 开启im-chat console.log(`主进程 [${type}]: 窗口注册-远程代理-完毕(${Date.now()})`) }) // 用于监听-状态管理变化-同步所有窗口 diff --git a/src/preload/index.js b/src/preload/index.js index ffdb7a0..a840ca5 100644 --- a/src/preload/index.js +++ b/src/preload/index.js @@ -1,10 +1,10 @@ import { contextBridge } from 'electron' import { electronAPI } from '@electron-toolkit/preload' -import TimRender from 'im_electron_sdk/dist/renderer' // im渲染部分实例 +// import TimRender from 'im_electron_sdk/dist/renderer' // im渲染部分实例 // Custom APIs for renderer const api = { preloadPath: __dirname, // 当前preload地址 - getTimRender: () => new TimRender(), // im渲染部分实例 + // getTimRender: () => new TimRender(), // im渲染部分实例 } // Use `contextBridge` APIs to expose Electron APIs to // renderer only if context isolation is enabled, otherwise diff --git a/src/renderer/index.html b/src/renderer/index.html index 60caf7f..bfa9a4f 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -8,12 +8,13 @@ http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:" /> --> - +
+