mirror of
https://github.com/palxiao/poster-design.git
synced 2025-07-15 16:02:19 +08:00
code: update drawLink
This commit is contained in:
parent
9cb2dde54b
commit
e1dcbb49b2
@ -3,7 +3,7 @@
|
||||
* @Date: 2022-02-01 13:41:59
|
||||
* @Description: 配置文件
|
||||
* @LastEditors: ShawnPhang <site: book.palxp.com>
|
||||
* @LastEditTime: 2023-07-06 14:53:05
|
||||
* @LastEditTime: 2023-09-04 14:09:51
|
||||
*/
|
||||
const isDev = process.env.NODE_ENV === 'development'
|
||||
|
||||
@ -14,6 +14,11 @@ exports.servicePort = 7001
|
||||
*/
|
||||
exports.executablePath = '/opt/google/chrome-unstable/chrome',
|
||||
|
||||
/**
|
||||
* 前端绘制页地址
|
||||
*/
|
||||
exports.drawLink = isDev ? 'http://localhost:3000/draw' : 'https://design.palxp.com/draw'
|
||||
|
||||
/**
|
||||
* 截图并发数上限
|
||||
*/
|
||||
|
@ -3,11 +3,11 @@
|
||||
* @Date: 2020-07-22 20:13:14
|
||||
* @Description:
|
||||
* @LastEditors: ShawnPhang <site: book.palxp.com>
|
||||
* @LastEditTime: 2023-09-04 10:54:52
|
||||
* @LastEditTime: 2023-09-04 14:08:10
|
||||
*/
|
||||
const { saveScreenshot } = require('../utils/download-single.ts')
|
||||
const uuid = require('../utils/uuid.ts')
|
||||
const { filePath, upperLimit } = require('../configs.ts')
|
||||
const { filePath, upperLimit, drawLink } = require('../configs.ts')
|
||||
const { queueRun, queueList } = require('../utils/node-queue.ts')
|
||||
// const path = require('path')
|
||||
const fs = require('fs')
|
||||
@ -55,11 +55,8 @@ module.exports = {
|
||||
* @apiParam {String} size 可选, 按比例缩小到宽度
|
||||
* @apiParam {String} quality 可选, 质量
|
||||
*/
|
||||
|
||||
const isDev = process.env.NODE_ENV === 'development'
|
||||
let { id, tempid, width, height, screenshot_url, type = 'file', size, quality } = req.query
|
||||
const defaultUrl = isDev ? 'http://localhost:3000/draw' : 'https://design.palxp.com/draw'
|
||||
const url = (screenshot_url || defaultUrl) + `${id ? '?id=' : '?tempid='}`
|
||||
const url = (screenshot_url || drawLink) + `${id ? '?id=' : '?tempid='}`
|
||||
id = id || tempid
|
||||
const path = filePath + `${id}-screenshot.png`
|
||||
const thumbPath = type === 'cover' ? filePath + `${id}-cover.jpg` : null
|
||||
|
Loading…
x
Reference in New Issue
Block a user