From 3a7c5556fda479b85889eb6923f3cb9ca8ad1872 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B2=A1=E5=A4=8D=E4=B9=A0?= <2353956224@qq.com>
Date: Tue, 26 Aug 2025 13:03:08 +0800
Subject: [PATCH] =?UTF-8?q?=E9=80=80=E5=87=BA=E6=B8=85=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/account.js | 3 ++-
src/views/HomeView.vue | 2 +-
src/views/VideoStream.vue | 54 ++++++++++++++++++++++++++++++++++++---
3 files changed, 53 insertions(+), 6 deletions(-)
diff --git a/src/api/account.js b/src/api/account.js
index a0a3660..22a04df 100644
--- a/src/api/account.js
+++ b/src/api/account.js
@@ -62,4 +62,5 @@ export function prologue() {
//获取评论
export function comment() {
return getAxios({ url: 'api/common/comment' })
-}
\ No newline at end of file
+}
+
diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue
index da7c488..1429a01 100644
--- a/src/views/HomeView.vue
+++ b/src/views/HomeView.vue
@@ -79,7 +79,7 @@ import { getToken, setToken, setUser, setUserPass, getUserPass } from '@/stores/
import { ElLoading, ElMessage } from 'element-plus';
-let version = ref('1.5.4');
+let version = ref('1.5.5');
onMounted(() => {
diff --git a/src/views/VideoStream.vue b/src/views/VideoStream.vue
index 93d0b5b..f921912 100644
--- a/src/views/VideoStream.vue
+++ b/src/views/VideoStream.vue
@@ -2,7 +2,11 @@
- 执行主播库
+
+ 执行主播库
+ 上传日志
+
+
@@ -65,7 +69,7 @@ import {
setphoneXYinfo, getphoneXYinfo, getUser,
getHostList, setHostList, addToHostList, getContentpriList,
setContentpriList, getContentList, setContentList,
- setsessionId, getsessionId
+ setsessionId, getsessionId, getToken
} from '@/stores/storage'
import { toBufferBtn, stringToUtf8ByteArray, getClipboard, setClipboard, bufferToString, startsWithHeader, trimLongArray, base64ToBinary, toBuffer } from '@/utils/bufferUtils';
import { createWsActions } from '@/utils/wsActions';
@@ -77,7 +81,7 @@ import ChatDialog from '@/components/ChatDialog.vue'
// import { splitArray } from '@/utils/arrUtil' //分割数组 分配主播 已废弃
import { chooseFile } from '@/utils/fileUtil'
import { connectSSE } from '@/utils/sseUtils'
-import { prologue, comment } from '@/api/account';
+import { prologue, comment, } from '@/api/account';
import { createTaskQueue } from '@/composables/useTaskQueue' //创建任务
import { useCanvasPointer } from '@/composables/useCanvasPointer' //canvas 初始化 点击转换
import { attachTrimmerForIndex } from '@/composables/useVideoStream' //修剪器
@@ -623,7 +627,7 @@ const initVideoStream = async (udid, index) => {
}, 800)
} else if (resData.type == 'tomy') {//打开主页
phoneXYinfo.value[index].tomy = { x: resData.x * iponeCoefficient.value[index].width, y: resData.y * iponeCoefficient.value[index].height }
- } else if (resData.type == 'Attention') {//关注、打开私信
+ } else if (resData.type == 'Attention') {//关注、打开私信
phoneXYinfo.value[index].Attention = { x: resData.x * iponeCoefficient.value[index].width, y: resData.y * iponeCoefficient.value[index].height }
// LikesToCommentToComPush(deviceInformation.value[index].udid, index) //是否继续循环任务
} else if (resData.type == 'return') {//私信评论
@@ -951,6 +955,10 @@ const handleVisibilityChange = () => {
onMounted(() => {
// document.addEventListener("visibilitychange", handleVisibilityChange);
+ // getExpiredTime().then((res) => {
+ // console.log('time:', res);
+ // })
+
ObtainDeviceInformation();
// window.addEventListener('keydown', (e) => {
// // console.log('触发按键了 键盘事件有效', e)
@@ -1066,6 +1074,7 @@ onBeforeUnmount(() => {
// 组件卸载时清理
onUnmounted(() => {
console.log("卸载组件");
+ td.disposeAll('logout')
cloesMonitor(); //关闭检测消息
});
@@ -1483,6 +1492,43 @@ function manualGc() {
window.electronAPI.manualGc()
}
+async function uploadLogFile() {
+ try {
+ // 先弹出确认框
+ await ElMessageBox.confirm(
+ '确定要上传日志文件吗?',
+ '提示',
+ {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning',
+ }
+ )
+ // 如果点了确定,就会走到这里
+ const loading = ElLoading.service({
+ lock: true,
+ text: '上传中...',
+ background: 'rgba(0, 0, 0, 0.7)',
+ })
+ const res = await window.electronAPI.uploadLogFile(userdata)
+ loading.close()
+ if (res.success) {
+ console.log("✅ 上传成功:", res)
+ ElMessage.success('✅ 上传成功')
+ } else {
+ console.error("❌ 上传失败:", res.msg)
+ ElMessage.error('❌ 上传失败: ' + (res.msg || '未知错误'))
+ }
+ } catch (err) {
+ // 如果用户点了取消,会进入这里
+ if (err === 'cancel' || err === 'close') {
+ ElMessage.info('已取消上传')
+ } else {
+ console.error("❌ 上传异常:", err)
+ ElMessage.error('❌ 上传异常: ' + err)
+ }
+ }
+}