From 1819eb8c5e6b89c9d4622ce003bdd370e69cb1f3 Mon Sep 17 00:00:00 2001 From: snowtafir Date: Wed, 18 Sep 2024 00:12:39 +0800 Subject: [PATCH] fix: Repeated Instantiation puppeteer --- CHANGELOG.md | 1 + package.json | 10 +++++----- utils/image.tsx | 9 +++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 889cab7..5f92250 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # 2.0.4 +* fix Repeated Instantiation puppeteer * 优化获取B站登录ck * 添加截图列队,优化配置文件注释 diff --git a/package.json b/package.json index 3dc4795..6b53372 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yuki-plugin", - "version": "2.0.4-2", + "version": "2.0.4-3", "author": "snowtafir", "description": "优纪插件,yunzai-V4 关于 微博推送、B站推送 等功能的拓展插件", "main": "./index", @@ -15,13 +15,13 @@ "url": "https://gitee.com/snowtafir/yuki-plugin" }, "dependencies": { - "axios": "^1.7.3", + "axios": "^1.7.7", "chokidar": "^3.6.0", "jsdom": "^24.1.1", "md5": "^2.3.0", "moment": "^2.30.1", "node-fetch": "^3.3.2", - "puppeteer": "^23.3.0", + "puppeteer": "^23.3.1", "qrcode": "^1.5.4", "react": "^18.3.1", "react-dom": "^18.3.1", @@ -47,13 +47,13 @@ "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@types/yaml": "1.9.7", - "axios": "^1.7.3", + "axios": "^1.7.7", "chokidar": "^3.6.0", "jsdom": "^24.1.1", "md5": "^2.3.0", "nodemon":"3.1.4", "node-fetch": "^3.3.2", - "puppeteer": "^23.3.0", + "puppeteer": "^23.3.1", "qrcode": "^1.5.4", "react": "^18.3.1", "react-dom": "^18.3.1", diff --git a/utils/image.tsx b/utils/image.tsx index 39d9f85..f6155fd 100644 --- a/utils/image.tsx +++ b/utils/image.tsx @@ -10,14 +10,15 @@ class Image extends Picture { /** * 构造函数,整合截图方法 + * @param launchOptions Puppeteer 启动选项,可选。父类有默认的设置。 */ constructor() { // 继承父类实例 super(); - // 组件渲染对象 - this.Com; - // 启动 Puppeteer - this.Pup.start(); + // 父类已经实例化组件渲染对象 + //this.Com; + // 父类已经实例化启动 Puppeteer + //this.Pup.start(); // 初始化 YukiPuppeteerRender 实例 this.yukiPuppeteerRender = new YukiPuppeteerRender(this.Pup); }