Skip to content

Commit 3817c63

Browse files
committed
fix: Troubleshooting G2 SSR request failure process
1 parent f022a1a commit 3817c63

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

g2-ssr/app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,14 @@ function getOptions(type, axis, data) {
5151
// 创建 Chart 和配置
5252
async function GenerateCharts(obj) {
5353
const options = getOptions(obj.type, JSON.parse(obj.axis), JSON.parse(obj.data));
54+
console.log('options')
5455
const chart = await createChart(options);
56+
console.log('createChart')
5557

5658
// 导出
5759
chart.exportToFile(obj.path || 'chart');
5860
// -> chart.png
61+
console.log('exportToFile')
5962

6063
chart.toBuffer();
6164
}
@@ -72,7 +75,9 @@ function toGet(req, res) {
7275
//获取POST请求内容、cookie
7376
function toPost(req, res) {
7477
req.on('data', async function (chunk) {
78+
console.log('data')
7579
await GenerateCharts(JSON.parse(chunk))
80+
console.log('toBuffer')
7681
res.end('complete');
7782
});
7883
}

0 commit comments

Comments
 (0)