mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
fix: Troubleshooting G2 SSR request failure process
This commit is contained in:
@@ -51,11 +51,14 @@ function getOptions(type, axis, data) {
|
||||
// 创建 Chart 和配置
|
||||
async function GenerateCharts(obj) {
|
||||
const options = getOptions(obj.type, JSON.parse(obj.axis), JSON.parse(obj.data));
|
||||
console.log('options')
|
||||
const chart = await createChart(options);
|
||||
console.log('createChart')
|
||||
|
||||
// 导出
|
||||
chart.exportToFile(obj.path || 'chart');
|
||||
// -> chart.png
|
||||
console.log('exportToFile')
|
||||
|
||||
chart.toBuffer();
|
||||
}
|
||||
@@ -72,7 +75,9 @@ function toGet(req, res) {
|
||||
//获取POST请求内容、cookie
|
||||
function toPost(req, res) {
|
||||
req.on('data', async function (chunk) {
|
||||
console.log('data')
|
||||
await GenerateCharts(JSON.parse(chunk))
|
||||
console.log('toBuffer')
|
||||
res.end('complete');
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user