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:
Archer
2024-09-27 15:52:33 +08:00
committed by GitHub
parent d259eda6b4
commit 98dbec2cf7
15 changed files with 135 additions and 166 deletions

View File

@@ -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)
};
};