From 1666d9aa14076ecce27b2d18efb1159094b2983a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=A1=E5=A4=8D=E4=B9=A0?= <2353956224@qq.com> Date: Mon, 1 Sep 2025 14:42:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=8D=87=E7=A8=B3=E5=AE=9A=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 33 ++++++++- package.json | 1 + src/components/LeftToolbar.vue | 1 + src/composables/useTaskQueue.js | 3 +- src/static/css/video.less | 3 +- src/utils/axios.js | 2 +- src/utils/sseUtils.js | 2 + src/utils/wsActions.js | 6 +- src/views/HomeView.vue | 6 +- src/views/VideoStream.vue | 123 +++++++++++++++++++++++--------- 10 files changed, 139 insertions(+), 41 deletions(-) diff --git a/package-lock.json b/package-lock.json index 11300cb..3020e3a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "@ffmpeg/core": "^0.12.10", "@ffmpeg/util": "^0.12.2", "@vueuse/core": "^13.1.0", + "amqplib": "^0.10.9", "axios": "^1.8.4", "core-js": "^3.8.3", "echarts": "^5.6.0", @@ -4466,6 +4467,18 @@ "ajv": "^6.9.1" } }, + "node_modules/amqplib": { + "version": "0.10.9", + "resolved": "https://registry.npmjs.org/amqplib/-/amqplib-0.10.9.tgz", + "integrity": "sha512-jwSftI4QjS3mizvnSnOrPGYiUnm1vI2OP1iXeOUz5pb74Ua0nbf6nPyyTzuiCLEE3fMpaJORXh2K/TQ08H5xGA==", + "dependencies": { + "buffer-more-ints": "~1.0.0", + "url-parse": "~1.5.10" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/ansi-escapes": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", @@ -4974,6 +4987,11 @@ "dev": true, "license": "MIT" }, + "node_modules/buffer-more-ints": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-more-ints/-/buffer-more-ints-1.0.0.tgz", + "integrity": "sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==" + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -11882,6 +11900,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -12153,7 +12176,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true, "license": "MIT" }, "node_modules/resolve": { @@ -13466,6 +13488,15 @@ "punycode": "^2.1.0" } }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/package.json b/package.json index 198d57d..990a1c4 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "@ffmpeg/core": "^0.12.10", "@ffmpeg/util": "^0.12.2", "@vueuse/core": "^13.1.0", + "amqplib": "^0.10.9", "axios": "^1.8.4", "core-js": "^3.8.3", "echarts": "^5.6.0", diff --git a/src/components/LeftToolbar.vue b/src/components/LeftToolbar.vue index 06c2353..339984c 100644 --- a/src/components/LeftToolbar.vue +++ b/src/components/LeftToolbar.vue @@ -36,6 +36,7 @@ const hoverIndex = ref(null) } .left-button { + cursor: default; position: relative; z-index: 999; margin-bottom: 19px; diff --git a/src/composables/useTaskQueue.js b/src/composables/useTaskQueue.js index 01ea40b..eac4dbb 100644 --- a/src/composables/useTaskQueue.js +++ b/src/composables/useTaskQueue.js @@ -11,7 +11,8 @@ export function createTaskQueue(index) { q.push(task); if (q.length === 1) task(); // 只有第一个任务时立即执行 }, - next() { + next(type, time) { + console.log('任务发送', index, type, time); const q = _queues.get(index) || []; q.shift(); if (q.length > 0) q[0](); // 执行下一个 diff --git a/src/static/css/video.less b/src/static/css/video.less index d88dd10..8b83b8d 100644 --- a/src/static/css/video.less +++ b/src/static/css/video.less @@ -142,7 +142,8 @@ video { .app-button { // background-color: darkcyan; - // color: white; + // color: white; 、 + cursor: default; width: 260px; height: 50px; background: linear-gradient(0deg, #4FCACD 0%, #5FDBDE 100%); diff --git a/src/utils/axios.js b/src/utils/axios.js index 93d7ff5..3ad8402 100644 --- a/src/utils/axios.js +++ b/src/utils/axios.js @@ -18,7 +18,7 @@ let baseURL = '' if (process.env.NODE_ENV === 'development') { // 生产环境 // baseURL = "https://api.tkpage.yolozs.com" - // baseURL = "http://192.168.1.155:8101" + // baseURL = "http://192.168.1.174:8101" baseURL = "https://crawlclient.api.yolozs.com" } else { // 测试环境 diff --git a/src/utils/sseUtils.js b/src/utils/sseUtils.js index c63e6b5..4949e06 100644 --- a/src/utils/sseUtils.js +++ b/src/utils/sseUtils.js @@ -17,7 +17,9 @@ export function connectSSE(url, onMessage) { } eventSource.onmessage = (event) => { + console.log('[SSE] 收到消息:', event) try { + const data = JSON.parse(event.data) if (onMessage) onMessage(data) } catch (e) { diff --git a/src/utils/wsActions.js b/src/utils/wsActions.js index 3231cef..1c2fa37 100644 --- a/src/utils/wsActions.js +++ b/src/utils/wsActions.js @@ -16,7 +16,7 @@ const mouseData = { export function createWsActions(wslist) { // 通用 ws 发送方法 function send(index, payload) { - console.log("发送任务", payload.type) + // console.log("发送任务", payload.type) if (wslist[index]) { setTimeout(() => { @@ -32,11 +32,15 @@ export function createWsActions(wslist) { open: (udid, index) => send(index, { udid, action: 'openDY' }), //打开tk killNow: (udid, index) => send(index, { udid, action: 'killNow' }), //关闭当前进程 install: (udid, index, path) => send(index, { udid, action: 'install', resourceId: path }), //安装应用 + installc: (udid, index) => send(index, { udid, action: 'installt', resourceId: 'clipper.apk' }), //安装应用clipper + startClipserve: (udid, index) => send(index, { udid, action: 'startClipserve' }), //安装应用clipper + installt: (udid, index) => send(index, { udid, action: 'installt', resourceId: 'tiktok-39-3-3.apk' }), //安装应用 tiktok pushFile: (udid, index, path) => send(index, { udid, action: 'pushFile', resourceId: path }), //发送文件 slideDown: (udid, index) => send(index, { udid, action: 'slideDown' }),//下滑动视频 slideUp: (udid, index) => send(index, { udid, action: 'slideUp' }),//上滑动视频 slideRight: (udid, index) => send(index, { udid, action: 'slideRight' }),//右滑动视频 getSize: (udid, index) => send(index, { udid, action: 'getSize', index }),//右滑动视频 + setClipboard: (udid, index, text, type) => send(index, { udid, action: 'setClipboard', type: type, index, resourceId: text }), //截屏测试 clickLikes: (udid, index) => send(index, { udid, action: 'click', type: 'Likes', index, resourceId: 'com.zhiliaoapp.musically:id/dy6' }),//点赞 clickComment: (udid, index) => send(index, { udid, action: 'click', type: 'Comment', index, resourceId: 'com.zhiliaoapp.musically:id/cvd' }),//打开评论 clickComtext: (udid, index) => send(index, { udid, action: 'click', type: 'Comtext', index, resourceId: 'com.zhiliaoapp.musically:id/cs0' }),//点开输入框 diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 1429a01..98f7f1c 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -1,5 +1,5 @@