qiushang 3 周之前
父节点
当前提交
47b21f8540
共有 3 个文件被更改,包括 26 次插入19 次删除
  1. 3 3
      nsis/test.nsi
  2. 1 1
      package.json
  3. 22 15
      src/renderer/components/home.vue

+ 3 - 3
nsis/test.nsi

@@ -1,16 +1,16 @@
 # ====================== 自定义宏 产品信息==============================
 !define PRODUCT_MID        		    "Ds8JqlRmiiGR"
-!define PRODUCT_VERSION        		"2.3.0.0"
+!define PRODUCT_VERSION        		"2.3.0.1"
 !define PRODUCT_NAME           		"星优图片下载助手"
 !define INSTALL_OUTPUT_NAME    		"XYCapture_XY.exe" 
 !define EXE_NAME               		"XYCapture.exe"
 !define PRODUCT_PATHNAME           	"XYCapture"     #安装卸载项用到的KEY,注册表
 !define INSTALL_APPEND_PATH         "XYCapture"     #安装路径追加的名称 
-!define APP_DOWNLOAD_URL    		"https://xy.xingyousoft.com/soft/XYCapture/lastest2.3.0.0.7z"
+!define APP_DOWNLOAD_URL    		"https://xy.xingyousoft.com/soft/XYCapture/lastest2.3.0.1.7z"
 !define PRODUCT_PUBLISHER      	    "苏州星优办公软件有限公司"
 !define PRODUCT_LEGAL          	    "苏州星优办公软件有限公司"
 !define STATISTICS_url              "https://www.xingyousoft.com/api/index/user_log"   # 统计网址
-!define UNINSTALL_url               "https://xy.xingyousoft.com/soft/XYCapture/uninstallWeb/?v=2.3.0.0"   # 接卸优惠网址
+!define UNINSTALL_url               "https://xy.xingyousoft.com/soft/XYCapture/uninstallWeb/?v=2.3.0.1"   # 接卸优惠网址
 
 # ====================== 自定义宏 安装信息==============================
 !define INSTALL_7Z_NAME 	   		"app.7z"

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 	"name": "XYCapture",
-	"version": "2.3.0.0",
+	"version": "2.3.0.1",
 	"author": "苏州星优办公软件有限公司",
 	"description": "An electron-vue project",
 	"license": "capture",

+ 22 - 15
src/renderer/components/home.vue

@@ -1015,6 +1015,10 @@
 					
 					let headless = true;
 					headless = this.initDevelop().headless;
+					let redSize = '';
+					if(this.menuIndex == '5'){
+						redSize = '--window-size=1280,800'; //给浏览器一个初始大小,在无头模式下,页面会自适用缩放
+					}
 					this[browserName] = await puppeteer.launch({
 						headless: headless,
 						executablePath: this.initPath(),
@@ -1023,7 +1027,8 @@
 							'--start-maximized',
 							'--no-sandbox',
 							'--disable-setuid-sandbox',
-							'--disable-blink-features=AutomationControlled'
+							'--disable-blink-features=AutomationControlled',
+							redSize
 						]
 					});
 					
@@ -1388,13 +1393,13 @@
 							}
 							this.loginBrowser = await puppeteer.launch({
 								executablePath: this.initPath(),
-								args: ['--window-size=1280,800'],
 								userDataDir: this.initDataDir('jd'),
 								args: [
 									'--start-maximized',
 									'--no-sandbox',
 									'--disable-setuid-sandbox',
-									'--disable-blink-features=AutomationControlled'
+									'--disable-blink-features=AutomationControlled',
+									'--window-size=1280,800'
 								]
 							});
 							const page = await this.loginBrowser.newPage();
@@ -2509,21 +2514,23 @@
 							
 							// 定位元素
 							const handle = await page.$$('.pagination-media-container .pagination-item'); 
-							if(handle.length > 0){ // 模拟鼠标拖动 将鼠标移动到元素的中心,然后开始拖动
+							if(handle.length > 0 && this.settingArr.indexOf('video') > -1){ // 模拟鼠标拖动 将鼠标移动到元素的中心,然后开始拖动
 								let handleLength = handle.length;
 								const box = await handle[0].boundingBox();
 								const boxEnd = await handle[handleLength - 1].boundingBox();
-								const center = {
-									x: box.x + box.width / 2,
-									y: box.y + box.height / 2
-								};
-								const centerEnd = {
-									x: boxEnd.x + boxEnd.width / 2,
-									y: boxEnd.y + boxEnd.height / 2
-								};
-								await page.mouse.move(center.x, center.y);
-								await page.mouse.down();
-								await page.mouse.move(centerEnd.x, centerEnd.y, { steps: 50 }); // 新的位置,可以根据需要调整步骤数
+								if(box && boxEnd){ //确保元素可见,防止报错
+									const center = {
+										x: box.x + box.width / 2,
+										y: box.y + box.height / 2
+									};
+									const centerEnd = {
+										x: boxEnd.x + boxEnd.width / 2,
+										y: boxEnd.y + boxEnd.height / 2
+									};
+									await page.mouse.move(center.x, center.y);
+									await page.mouse.down();
+									await page.mouse.move(centerEnd.x, centerEnd.y, { steps: 50 }); // 新的位置,可以根据需要调整步骤数
+								}
 							}
 							
 							//detailImg:详情图;skuImg:sku图片;commentImg: 评论图;video: 视频