diff --git a/src/temp/1561374259596.png b/src/temp/1561374259596.png new file mode 100644 index 0000000..be41d15 Binary files /dev/null and b/src/temp/1561374259596.png differ diff --git a/src/temp/1561374267583.png b/src/temp/1561374267583.png new file mode 100644 index 0000000..be41d15 Binary files /dev/null and b/src/temp/1561374267583.png differ diff --git a/src/utils/painter/index.js b/src/utils/painter/index.js index 9248422..67e4386 100644 --- a/src/utils/painter/index.js +++ b/src/utils/painter/index.js @@ -1,4 +1,5 @@ const { registerFont, createCanvas, loadImage } = require('canvas'); +const path = require('path') const drawRoundRect = require('./round_rect'); const wrapText = require('./wrap_text'); @@ -59,7 +60,7 @@ module.exports = async function paint(opt) { // 生成图片 const tempName = `${new Date().getTime()}.png`; - const tempPath = config.root + `/src/temp/${tempName}`; + const tempPath = path.join(__dirname, '../../temp/' + tempName); transformBase64(canvas.toDataURL(), tempPath); return tempName;