From 57b7d3d60179292838adf43626b2b1c635e4f73a Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Fri, 16 Aug 2024 13:42:19 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E4=BA=8C=E6=9C=9F=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=87=AA=E5=8A=A8=E5=90=8C=E6=AD=A5=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/file.js | 21 ++++++++++++++----- .../prepare/container/file-list-item.vue | 8 +++---- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/main/file.js b/src/main/file.js index 348c703..9dcba26 100644 --- a/src/main/file.js +++ b/src/main/file.js @@ -42,19 +42,23 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) { let filePath = appRootFilePath + fileNewName let uploadId = null let isOn = false + let lastMTime = fs.statSync(filePath).mtime.getTime() + console.log(lastMTime) setInterval(() => { - getFileMD5(filePath).then((md5New) => { - if (md5New !== md5) { - md5 = md5New + getFileMsg(filePath).then((msg) => { + if (msg !== lastMTime) { + lastMTime = msg if (uploadId) { clearTimeout(uploadId) } if (isOn === false) { + console.log(fileNewName) e.reply('listen-file-change-on' + fileNewName) isOn = true } //倒数十秒提交更改,十秒之内有继续修改则重置倒数 uploadId = setTimeout(() => { + console.log(223) //执行更新,上传文件 let formData = new FormData() formData.append('id', id) @@ -77,12 +81,19 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) { console.error('Error uploading file:', err) } }) - }, 20000) + }, 5000) } }) - }, 10000) + }, 1000) }) + function getFileMsg(path) { + return new Promise((resolve, reject) => { + const stats = fs.statSync(path) + return resolve(stats.mtime.getTime()) + }) + } + function getFileMD5(path) { return new Promise((resolve, reject) => { fs.readFile(path, (err, dataFile) => { diff --git a/src/renderer/src/views/prepare/container/file-list-item.vue b/src/renderer/src/views/prepare/container/file-list-item.vue index 77de6b1..8c4f2dc 100644 --- a/src/renderer/src/views/prepare/container/file-list-item.vue +++ b/src/renderer/src/views/prepare/container/file-list-item.vue @@ -246,12 +246,12 @@ export default { fileType: item.fileType }) ipcRenderer.on('listen-file-change-on' + item.fileNewName, () => { - item.async = 'on' + items.async = 'on' }) ipcRenderer.on('listen-file-change-success' + item.fileNewName, (e, { data, md5 }) => { - item.fileSize = data.fileSize - item.md5 = md5 - item.async = true + items.fileSize = data.fileSize + items.md5 = md5 + items.async = true }) } }) From 0ff0cd42bcc87ebcb6366bafd76b881629f83f84 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Fri, 16 Aug 2024 18:10:20 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E4=BA=8C=E6=9C=9F=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=87=AA=E5=8A=A8=E5=90=8C=E6=AD=A5=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 +-- src/main/file.js | 7 ++++--- src/renderer/src/plugins/shareStore.js | 6 ++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 71aafb4..1629b15 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aix-win", - "version": "1.1.1", + "version": "1.1.2", "description": "An Electron application with Vue", "main": "./out/main/index.js", "author": "example.com", @@ -33,7 +33,6 @@ "electron-updater": "^6.1.7", "element-plus": "^2.7.6", "fabric": "^5.3.0", - "im_electron_sdk": "^8.0.5904", "js-cookie": "^3.0.5", "jsencrypt": "^3.3.2", "jsondiffpatch": "0.6.0", diff --git a/src/main/file.js b/src/main/file.js index 9dcba26..ddabb2c 100644 --- a/src/main/file.js +++ b/src/main/file.js @@ -132,13 +132,14 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) { e.reply('is-async-local-file-reply' + fileNewName, { isAsync: true, type: 'down' }) return } - getFileMD5(filePath).then((localMd5) => { - if (localMd5 === md5) { + getFileMsg(filePath).then((msg) => { + let time = new Date(lastModifyTime).getTime(); + msg = parseInt(msg/1000)*1000; + if (msg == time) { e.reply('is-async-local-file-reply' + fileNewName, { isAsync: false, type: '' }) } else { const stats = fs.statSync(filePath) //如果线上时间大于线下时间,就需要从线上下载,否则则需要上传 - let time = new Date(lastModifyTime) if (time > stats.mtime.getTime()) { e.reply('is-async-local-file-reply' + fileNewName, { isAsync: true, type: 'down' }) } else if (time < stats.mtime.getTime()) { diff --git a/src/renderer/src/plugins/shareStore.js b/src/renderer/src/plugins/shareStore.js index 31060a8..bb003b8 100644 --- a/src/renderer/src/plugins/shareStore.js +++ b/src/renderer/src/plugins/shareStore.js @@ -12,7 +12,7 @@ export function shareStorePlugin({store}) { // console.log('store.$subscribe', mutation) // 在存储变化的时候执行 // const storeName = store.$id - // const storeName = mutation.storeId + const storeName = mutation.storeId // 用于多窗口共享(需要共享的状态名称) const names = ['tool'] if (names.includes(storeName)) { @@ -37,7 +37,9 @@ export function shareStorePlugin({store}) { function stateSync(storeName, key, value) { // console.log('state-change', storeName, key, value) let jsonStr = '' - if (typeof key === 'string') jsonStr = JSON.stringify({[key]:value}) + let obj = {[key]:value} + window.test = obj + if (typeof key === 'string') jsonStr = JSON.stringify(obj) else if (typeof value === 'object') jsonStr = JSON.stringify(key) // 通知主线程更新 ipcRenderer?.invoke('pinia-state-change', storeName, jsonStr) From 5f6839058ab56726fc414cf81efed5a42ac34e9b Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Mon, 19 Aug 2024 14:18:39 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E4=BA=8C=E6=9C=9F=EF=BC=9A=E6=89=93?= =?UTF-8?q?=E5=8C=85IM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/package.json b/package.json index 1629b15..f37b315 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "js-cookie": "^3.0.5", "jsencrypt": "^3.3.2", "jsondiffpatch": "0.6.0", + "im_electron_sdk": "^8.0.5904", "lodash": "^4.17.21", "pdfjs-dist": "4.4.168", "pinia": "^2.1.7", @@ -61,5 +62,80 @@ "vite-plugin-windicss": "^1.9.3", "vue": "^3.4.30", "windicss": "^3.5.6" + }, + "build": { + "files": [ + "src/app", + "bundle", + "icon" + ], + "appId": "aix-win", + "mac": { + "gatekeeperAssess": false, + "hardenedRuntime": true, + "entitlements": "./signing/entitlements.mac.plist", + "entitlementsInherit": "./signing/entitlements.mac.plist", + "extendInfo": { + "NSMicrophoneUsageDescription": "Please give us access to your microphone", + "NSCameraUsageDescription": "Allow your conversational partners to see you in a Grape Call. You can turn off your video anytime during a call." + }, + "icon": "./icon/im_electron_logo.png", + "extraFiles": [ + { + "from": "./node_modules/im_electron_sdk/lib/", + "to": "./Resources", + "filter": [ + "**/*" + ] + }, + + { + "from": "./icon/", + "to": "./Resources", + "filter": [ + "**/*" + ] + } + ] + }, + "win": { + "icon": "./resources/logo.ico", + "target": [ + { + "target": "nsis", + "arch": [ + "x64" + ] + } + ], + "extraFiles": [ + { + "from": "./node_modules/im_electron_sdk/lib/", + "to": "./resources", + "filter": [ + "**/*" + ] + } + ] + }, + "linux": { + "target": "deb", + "extraFiles": [ + { + "from": "./node_modules/im_electron_sdk/lib/", + "to": "./resources", + "filter": [ + "**/*" + ] + }, + { + "from": "node_modules/trtc-electron-sdk/build/Release/", + "to": "./resources", + "filter": [ + "**/*" + ] + } + ] + } } } From d4982d47c76a572b81edd6a09d1eb53e584e5496 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Fri, 23 Aug 2024 12:01:21 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E4=BA=8C=E6=9C=9F=EF=BC=9A=E6=89=93?= =?UTF-8?q?=E5=8C=85IM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7e805fd..7af5238 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aix-win", - "version": "1.1.2", + "version": "1.1.3", "description": "An Electron application with Vue", "main": "./out/main/index.js", "author": "example.com", From 0ea628d1748d75dae7a6f803c612f9d1949eaa04 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Fri, 23 Aug 2024 12:01:43 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E4=BA=8C=E6=9C=9F=EF=BC=9A=E6=89=93?= =?UTF-8?q?=E5=8C=85IM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/index.js b/src/main/index.js index da96c0b..1a38d28 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -135,6 +135,11 @@ async function createLinkWin(data) { .then(() => {}) .catch((error) => {}) data.fullPath = data.fullPath.replaceAll('//', '/') + if (data.fullPath.indexOf('?') !== -1) { + data.fullPath += '&urlSource=smarttalk' + }else { + data.fullPath += '?urlSource=smarttalk' + } linkWin[data.key].loadURL(data.fullPath) linkWin[data.key].once('ready-to-show', () => { From b6504e114fc62dfce2a9060c4fab5727e29b55c1 Mon Sep 17 00:00:00 2001 From: zdg Date: Tue, 3 Sep 2024 16:01:40 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E6=A1=8C=E9=9D=A2=EF=BC=8C=E5=BA=95?= =?UTF-8?q?=E9=83=A8=E5=AF=BC=E8=88=AA=20=E5=A4=9A=E4=B8=AA=E7=AA=97?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/utils/tool.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/renderer/src/utils/tool.js b/src/renderer/src/utils/tool.js index 21be23c..de9b303 100644 --- a/src/renderer/src/utils/tool.js +++ b/src/renderer/src/utils/tool.js @@ -14,11 +14,11 @@ const API = isNode?window.api:{} // preload-api // import { useToolState } from '@/store/modules/tool' // 获取store状态 // const Store = isNode?require('electron-store'):null // 持久化存储 import store from './store' - // 常用变量 const BaseUrl = isNode?process.env['ELECTRON_RENDERER_URL']+'/#':'' const isDev = isNode?process.env.NODE_ENV !== 'production':'' // const toolState = useToolState() // 获取store状态 +const appPath = isNode?Remote.app.getAppPath():'' // 应用目录 // 暴露Remote中的属性 export const ipcMain = Remote?.ipcMain || {} @@ -110,6 +110,7 @@ export const createWindow = async (type, data) => { resizable: false, // 禁止窗口大小缩放 transparent: true, // 设置透明 alwaysOnTop: true, // 窗口是否总是显示在其他窗口之前 + type: 'toolbar', // 创建的窗口类型为工具栏窗口 // parent: mainWin, // 父窗口 // autoClose: true, // 关闭窗口后自动关闭 } @@ -141,8 +142,8 @@ export const createWindow = async (type, data) => { const option = data.option||{} const defOption = { frame: false, // 要创建无边框窗口 - resizable: true, // 禁止窗口大小缩放 - alwaysOnTop: false, // 窗口是否总是显示在其他窗口之前 + resizable: true, // 禁止窗口大小缩放 + alwaysOnTop: false, // 窗口是否总是显示在其他窗口之前 } data.isConsole = true // 是否开启控制台 data.option = {...defOption, ...option} @@ -179,8 +180,7 @@ export function toolWindow({url, isConsole, isWeb=true, option={}}) { return new Promise((resolve) => { const config = { width, height, - type: 'toolbar', // 创建的窗口类型为工具栏窗口 - // icon: path.join(__dirname, '../../resources/logo2.ico'), + icon: path.join(appPath, '/resources/logo2.ico'), webPreferences: { preload: path.join(API.preloadPath, '/index.js'), sandbox: false, From cfac2086e6169a2a3d1091c2b7ec50569fe42ca6 Mon Sep 17 00:00:00 2001 From: yangws <1607839436@qq.com> Date: Tue, 3 Sep 2024 16:31:40 +0800 Subject: [PATCH 07/10] =?UTF-8?q?fix=EF=BC=9A=E7=9C=8B=E4=B8=8D=E4=BA=86?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E4=BF=A1=E6=81=AF=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/classManage/studentList.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/src/views/classManage/studentList.vue b/src/renderer/src/views/classManage/studentList.vue index b5edb47..f0ec324 100644 --- a/src/renderer/src/views/classManage/studentList.vue +++ b/src/renderer/src/views/classManage/studentList.vue @@ -13,7 +13,7 @@
@@ -46,6 +46,7 @@ const props = defineProps({ } }) const basePath = import.meta.env.VITE_APP_BUILD_BASE_PATH +const toolStore = useToolState() // 获取状态管理-tool const openEdit = () => { emit('openEdit', props.item) } @@ -61,18 +62,20 @@ const deleteReserv = () => { }) } const startClassR = (item) => { - startClass(item.id).then((res) => { - if (res.data === true) { - item.status = '上课中' - openLesson() - } - }) + // startClass(item.id).then((res) => { + // if (res.data === true) { + // item.status = '上课中' + // openLesson() + // } + // }) + item.status = '上课中' + openLesson() } // const toolStore = useToolState() let wins = null; // 上课-工具类悬浮 const openLesson = () => { - startClass(props.item.id) + // startClass(props.item.id) listEntpcourse({ evalid: props.item.ex2, edituserid: useUserStore().user.userId, diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index 7b2c3bc..7f49460 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -20,11 +20,11 @@
- + @@ -630,6 +630,7 @@ export default { cursor: pointer !important; } & > :deep(span) { + pointer-events: none; flex-direction: column !important; font-size: 12px; } diff --git a/src/renderer/src/views/tool/sphere.vue b/src/renderer/src/views/tool/sphere.vue index 256b4fe..745475c 100644 --- a/src/renderer/src/views/tool/sphere.vue +++ b/src/renderer/src/views/tool/sphere.vue @@ -96,10 +96,11 @@ const getClassInfo = async () => { const { data } = await classManageApi.getClassInfo(classObj.id) classObj.data = data // 群id - let timGroupId = data?.ex3 || '' + let timGroupId = data?.ex3 || '@TGS#36AICW6O6' console.log('获取群ID:', timGroupId) - const chat = await imChatRef.value?.initImChat(timGroupId) // 初始化im-chat - if (!timGroupId) timGroupId = chat?.timGroupId + // const chat = await imChatRef.value?.initImChat(timGroupId) // 初始化im-chat + // if (!timGroupId) timGroupId = chat?.timGroupId + if (!timGroupId) return ElMessage.error('房间创建-失败') classManageApi.startClass(classObj.id, timGroupId) // 开始上课 } // 切换tab-change From 2aaa15230a0fd258942962b5dd6dd860284ca761 Mon Sep 17 00:00:00 2001 From: zdg Date: Tue, 3 Sep 2024 18:03:25 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E6=81=A2=E5=A4=8D=20im=20=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/tool/sphere.vue | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/renderer/src/views/tool/sphere.vue b/src/renderer/src/views/tool/sphere.vue index 745475c..d5c015b 100644 --- a/src/renderer/src/views/tool/sphere.vue +++ b/src/renderer/src/views/tool/sphere.vue @@ -83,9 +83,6 @@ const btnList = [ // 工具栏按钮列表 // === 页面加载完毕 === onMounted(async() => { if (!electron) return // 浏览器端 - // console.log(sessionStore) - // window.test = sessionStore - // window.test1 = toolStore getClassInfo() // 获取课堂详情 ex3 resetStatus() // 开启重置状态-监听 }) @@ -98,8 +95,8 @@ const getClassInfo = async () => { // 群id let timGroupId = data?.ex3 || '@TGS#36AICW6O6' console.log('获取群ID:', timGroupId) - // const chat = await imChatRef.value?.initImChat(timGroupId) // 初始化im-chat - // if (!timGroupId) timGroupId = chat?.timGroupId + const chat = await imChatRef.value?.initImChat(timGroupId) // 初始化im-chat + if (!timGroupId) timGroupId = chat?.timGroupId if (!timGroupId) return ElMessage.error('房间创建-失败') classManageApi.startClass(classObj.id, timGroupId) // 开始上课 }