mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
修复Miao-Yunzai无法使用新渲染的问题 (#372)
* 修复后台API反代地址未能正确显示的问题 * 更新渲染页面配置 * 添加个人聊天模式配置 * 将用户数据获取改到common中 * 修复错误的渲染页面参数 * 修复bug * 添加Live2D * 修复渲染页面错误 * 修复渲染传入值 * 更新渲染 * 修复图表渲染bug * 调整live2d模型大小 * 修复live2d无法关闭问题 * 修复错误的传值 * 修复ai命名 * 更新渲染 * 添加用户独立设定 * 更新渲染配置适配个人设置 * 修复合并导致的渲染文件异常删除 * 修复用户数据缺失问题 * 修复旧版本数据缺失问题 * 修复bing参数不存在问题,兼容miao的截图 * 修复受限token重试时不被排除的问题
This commit is contained in:
parent
3e1fcad103
commit
36a51856c5
3 changed files with 25 additions and 6 deletions
|
|
@ -5,7 +5,8 @@ import lodash from 'lodash'
|
|||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import buffer from 'buffer'
|
||||
import puppeteer from '../../../lib/puppeteer/puppeteer.js'
|
||||
import yaml from 'yaml'
|
||||
// import puppeteer from '../../../lib/puppeteer/puppeteer.js'
|
||||
import { Config } from './config.js'
|
||||
// export function markdownToText (markdown) {
|
||||
// return remark()
|
||||
|
|
@ -14,6 +15,24 @@ import { Config } from './config.js'
|
|||
// .toString()
|
||||
// }
|
||||
|
||||
let puppeteer
|
||||
try {
|
||||
const Puppeteer = (await import('../../../renderers/puppeteer/lib/puppeteer.js')).default
|
||||
let puppeteerCfg = {}
|
||||
let configFile = `./renderers/puppeteer/config.yaml`
|
||||
if (fs.existsSync(configFile)) {
|
||||
try {
|
||||
puppeteerCfg = yaml.parse(fs.readFileSync(configFile, 'utf8'))
|
||||
} catch (e) {
|
||||
puppeteerCfg = {}
|
||||
}
|
||||
}
|
||||
puppeteer = new Puppeteer(puppeteerCfg)
|
||||
} catch (e) {
|
||||
logger.warn('未能加载puppeteer,尝试降级到Yunzai的puppeteer尝试')
|
||||
puppeteer = (await import('../../../lib/puppeteer/puppeteer.js')).default
|
||||
}
|
||||
|
||||
let localIP = ''
|
||||
export function escapeHtml (str) {
|
||||
const htmlEntities = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue