From 9eab9aa71f0227baf2e71eb491cb361404b090ca Mon Sep 17 00:00:00 2001 From: zhl Date: Fri, 21 May 2021 16:03:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0puppeteer=E9=A2=9D=E5=A4=96?= =?UTF-8?q?=E7=9A=84=E5=90=AF=E5=8A=A8=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/File.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/services/File.ts b/src/services/File.ts index 1bbf759..62c6f71 100644 --- a/src/services/File.ts +++ b/src/services/File.ts @@ -3,7 +3,7 @@ import * as jetpack from 'fs-jetpack' import { Game } from '../models/content/Game' import { ZError } from '../common/ZError' import { generateQr } from './Wechat' -import nodeHtmlToImage from 'node-html-to-image' +import nodeHtmlToImage, { NodeHtmlToImageOptions } from 'node-html-to-image' export function generateUploadPath(subPath: string) { @@ -74,11 +74,13 @@ export function generateCouponImg(shop: string, couponId: string, content: strin html: content, transparent: false, puppeteerArgs: { + args: ['--no-sandbox', '--disable-setuid-sandbox'], defaultViewport: { width: 375, height: 667, isMobile: true - }} + }}, + }) }