From 68cf2bae1f8c5525e6fb38b46408a05c9f75e76e Mon Sep 17 00:00:00 2001 From: zdg Date: Fri, 27 Sep 2024 09:27:51 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=B1=8F=E8=94=BD=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/index.js | 5 ----- src/renderer/src/plugins/shareStore.js | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index f6803fe..a8ce9ec 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -280,14 +280,9 @@ function handleAll() { }) // 用于监听-状态管理变化-同步所有窗口 ipcMain.handle('pinia-state-change', (e, storeName, jsonStr) => { - console.log('pinia-state-change-1', storeName, jsonStr) - for(const curWin of BrowserWindow.getAllWindows()){ const id = curWin.webContents.id const bool = id !== e.sender.id && !curWin.isDestroyed() - if (id === e.sender.id) { - console.log('pinia-state-change-2', 'windows-send', curWin.type) - } if (bool) { // 除了消息发送窗口和销毁的窗口 其他都发送 curWin.webContents.send('pinia-state-set', storeName, jsonStr) } diff --git a/src/renderer/src/plugins/shareStore.js b/src/renderer/src/plugins/shareStore.js index c4c2567..ba893d2 100644 --- a/src/renderer/src/plugins/shareStore.js +++ b/src/renderer/src/plugins/shareStore.js @@ -57,7 +57,7 @@ function stateSyncWatch(storeName, newState) { const diffData = findDifferences(oldState, newState) if(!_.keys(diffData).length) return // 没有变化就终止执行 // 数据处理: 找出差异 - console.log('state-change-diffData', diffData) + // console.log('state-change-diffData', diffData) try { let pinaValue = {} // store pina状态管理需要的数据格式 // 数据转换处理 @@ -116,7 +116,7 @@ function stateSyncInit(wid, store) { function sessionWatch(store) { const unsubscribe = sessionStore.onDidAnyChange((newV, oldV) => { if (newV !== oldV) { - console.log('session-change', newV, oldV) + // console.log('session-change', newV, oldV) // 通知主线程更新 // ipcRenderer?.invoke('pinia-state-change', storeName, jsonStr) } @@ -129,7 +129,7 @@ function stateChange(store) { const storeName = store.$id ipcRenderer?.on('pinia-state-set', (e, sName, jsonStr) => { if (sName == storeName) { // 更新对应数据 - console.log('state-set', jsonStr, sName) + // console.log('state-set', jsonStr, sName) const curJson = circularSafeStringify(store.$state) // 当前数据 const isUp = curJson != jsonStr // 不同的时候才写入,不然会导致触发数据变化监听,导致死循环 if (!isUp) return From e2e8cae690f8555b518feed897ada8727fc15ffe Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Fri, 27 Sep 2024 11:00:03 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=83=8C=E6=99=AF=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/prepare/index.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index a872138..40469a7 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -711,7 +711,10 @@ export default { .page-center-wrap{ flex: 1; height: 100%; - padding: 0 10px; + padding: 0 5px; + margin: 0 5px; + border-radius: 10px; + background-color: white; .prepare-center-jxkj{ height: 100%; display: flex; From eaf9d508d41bfe31c8164473c757f1900e6b008d Mon Sep 17 00:00:00 2001 From: zdg Date: Fri, 27 Sep 2024 15:52:07 +0800 Subject: [PATCH 3/4] =?UTF-8?q?apt=E4=B8=8A=E8=AF=BE-=E6=97=A0=E9=9C=80?= =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/api/apiService.js | 10 +++++ .../views/prepare/container/class-start.vue | 41 +++++++++++++++---- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/src/renderer/src/api/apiService.js b/src/renderer/src/api/apiService.js index 0b28e0d..d5d1668 100644 --- a/src/renderer/src/api/apiService.js +++ b/src/renderer/src/api/apiService.js @@ -26,3 +26,13 @@ export class imChat { // 获取腾讯im-chat appid 签名 static getTxCloudSign = data => ApiService.publicHttp('/system/user/txCloudSign', data) } + +// zdg: url跳转-后端存储 +export class toLink { + // 设置链接-返回key(默认15分钟有效时间) + static setLink = url => ApiService.publicHttp(`/smarttalk/toLink`, {url}, 'post', null, 'form') + // 获取链接 + static getLink = key => ApiService.publicHttp(`/smarttalk/toLink/${key}`) + // 删除链接-缓存 + static delLink = key => ApiService.publicHttp(`/smarttalk/toLink/${key}`, null, 'delete') +} diff --git a/src/renderer/src/views/prepare/container/class-start.vue b/src/renderer/src/views/prepare/container/class-start.vue index f2a73e4..ed30234 100644 --- a/src/renderer/src/views/prepare/container/class-start.vue +++ b/src/renderer/src/views/prepare/container/class-start.vue @@ -85,12 +85,14 @@ import vueQr from 'vue-qr/src/packages/vue-qr.vue' // 插件: 二维码 import imChat from '@/views/tool/components/imChat.vue' // im-chat-子组件 import MsgEnum from '@/plugins/imChat/msgEnum' // 消息头-相关定义(nuem) import * as commUtil from '@/utils/comm' // 工具类-通用 -import { toLinkWeb, getStaticUrl } from '@/utils/tool' +import { toLinkWeb, getStaticUrl } from '@/utils/tool' // 工具类-主进程相关 import * as Http_ClassManage from '@/api/classManage' // api接口 import * as Http_Classcourse from '@/api/teaching/classcourse' // api接口 -import * as Http_Entpcoursefile from '@/api/education/entpcoursefile' // api接口 +import * as Http_Entpcoursefile from '@/api/education/entpcoursefile' // api接口 +import * as Http_api from '@/api/apiService' // api接口 import useUserStore from "@/store/modules/user" // 状态管理:user +import CryptoJS from 'crypto-js' const baseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH const userStore = useUserStore() @@ -189,9 +191,9 @@ const getClassList = async () => { }) if (res.code == 200) { listData.classList = (res.rows || []).map(o => { - if(!!o.classstudentlist) { // 学生列表转为数组 - o.classstudentlist = JSON.parse('[' + o.classstudentlist + ']') - } + // if(!!o.classstudentlist) { // 学生列表转为数组 + // o.classstudentlist = JSON.parse('[' + o.classstudentlist + ']') + // } return o }); // 默认选中第一项 @@ -277,11 +279,34 @@ const classTeachingStart = async () => { } } // 获取二维码地址 -const getQrUrl = () => { +const getQrUrl = async() => { const { classcourseid:id } = teacherForm.form - const { userName } = userStore.user + const { userName, userId } = userStore.user if (!id||!userName) return - const qrCodeUrl = `wxlogin?username=${userName}&nextaction=classteaching&id=${id}` + // 原始方法(需要wx登录) + // const qrCodeUrl = `wxlogin?username=${userName}&nextaction=classteaching&id=${id}` + // teacherForm.form.qrUrl = baseUrl + qrCodeUrl + // const baseUrl = 'https://localhost:7860' + // token跳转 + const url = `/teaching/classteachingonmobile?classcourseid=${id}` // 跳转移动端-上课 + let qrCodeUrl = '' // 移动端-二维码地址 + try { + // 走后端缓存url + const res = await Http_api.toLink.setLink(url) // 设置链接-缓存 + if (res.code == 200) { + const redisKey = res.data + const base64Key = CryptoJS.enc.Utf8.parse(redisKey).toString(CryptoJS.enc.Base64) // base64加密 + const enStrUrl = encodeURIComponent(base64Key) // url转码 + qrCodeUrl = `?_server=${enStrUrl}` + teacherForm.form.qrUrl = baseUrl + qrCodeUrl + } + } catch (error) { // 异常, 直接加密token + const jsonStr = JSON.stringify({ url, token: userStore.token }) // json数据:{url, token} + const key = `Ax19i14Ga6qEDOkGTo` // AES加密-key + const enStr = CryptoJS.AES.encrypt(jsonStr, key).toString() // AES加密-数据 + const enStrUrl = encodeURIComponent(enStr) // url转码 + qrCodeUrl = `?_web=${enStrUrl}` + } teacherForm.form.qrUrl = baseUrl + qrCodeUrl } From 310d1aee593daed1475ba68528bd60ac7d09fb4c Mon Sep 17 00:00:00 2001 From: lyc Date: Fri, 27 Sep 2024 15:55:50 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=95=99=E5=AD=A6=E5=A4=A7=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/components/ai-chart/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/ai-chart/index.vue b/src/renderer/src/components/ai-chart/index.vue index 18b00f5..5234683 100644 --- a/src/renderer/src/components/ai-chart/index.vue +++ b/src/renderer/src/components/ai-chart/index.vue @@ -122,7 +122,8 @@ const outerAi = [ title: '教学大模型', secondTit: '中小学基础教学大模型', img: new URL('../../../src/assets/images/ai-02.png', import.meta.url).href, - disabled: true, + path: '/ais/aimoss' + }, { id: 3,