4.8.11 fix (#2822)
* fix: tool choice hostiry error * fix: chat page auth error redirect * perf: ip redirect tip * feat: fedomain env * fix: tool desc empty * feat: 4811 doc
This commit is contained in:
@@ -25,7 +25,7 @@ type Option = {
|
||||
series: SeriesData[]; // 使用定义的类型
|
||||
};
|
||||
|
||||
const generateChart = (title: string, xAxis: string, yAxis: string, chartType: string) => {
|
||||
const generateChart = async (title: string, xAxis: string, yAxis: string, chartType: string) => {
|
||||
// @ts-ignore 无法使用dom,如使用jsdom会出现生成图片无法正常展示,有高手可以帮忙解决
|
||||
const chart = echarts.init(undefined, undefined, {
|
||||
renderer: 'svg', // 必须使用 SVG 模式
|
||||
@@ -39,8 +39,9 @@ const generateChart = (title: string, xAxis: string, yAxis: string, chartType: s
|
||||
try {
|
||||
parsedXAxis = JSON.parse(xAxis);
|
||||
parsedYAxis = JSON.parse(yAxis);
|
||||
} catch (error: unknown) {
|
||||
} catch (error: any) {
|
||||
console.error('解析数据时出错:', error);
|
||||
return Promise.reject('Data error');
|
||||
}
|
||||
|
||||
const option: Option = {
|
||||
@@ -86,7 +87,7 @@ const generateChart = (title: string, xAxis: string, yAxis: string, chartType: s
|
||||
|
||||
const main = async ({ title, xAxis, yAxis, chartType }: Props): Response => {
|
||||
return {
|
||||
result: generateChart(title, xAxis, yAxis, chartType)
|
||||
result: await generateChart(title, xAxis, yAxis, chartType)
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user