diff --git a/backend/apps/chat/curd/chat.py b/backend/apps/chat/curd/chat.py index 8338cf2b..2d573070 100644 --- a/backend/apps/chat/curd/chat.py +++ b/backend/apps/chat/curd/chat.py @@ -60,7 +60,7 @@ def get_chat_predict_data(session: SessionDep, chart_record_id: int): res = session.query(ChatRecord).options(load_only(ChatRecord.predict_data)).get(chart_record_id) if res: try: - return orjson.loads(res.data) + return orjson.loads(res.predict_data) except Exception: pass return '' diff --git a/backend/apps/system/api/user.py b/backend/apps/system/api/user.py index 9d9644cd..825679cf 100644 --- a/backend/apps/system/api/user.py +++ b/backend/apps/system/api/user.py @@ -153,7 +153,7 @@ async def update(session: SessionDep, editor: UserEditor, trans: Trans): raise Exception(f"User with id [{editor.id}] not found!") if editor.account != user_model.account: raise Exception(f"account cannot be changed!") - if editor.email != user_model.email and check_email_exists(session=session, account=editor.email): + if editor.email != user_model.email and check_email_exists(session=session, email=editor.email): raise Exception(trans('i18n_exist', msg = f"{trans('i18n_user.email')} [{editor.email}]")) if not check_email_format(editor.email): raise Exception(trans('i18n_format_invalid', key = f"{trans('i18n_user.email')} [{editor.email}]")) diff --git a/backend/template.yaml b/backend/template.yaml index bc0e1fb4..a88989f7 100644 --- a/backend/template.yaml +++ b/backend/template.yaml @@ -138,7 +138,7 @@ template: predict: system: | ### 说明: - 你是一个数据分析师,你的任务是根据给定的数据进行数据预测,我将以json格式给你一组数据,你帮我预测之后的数据(一段可以展示趋势的数据,至少2个周期),用json格式返回,返回的格式需要与传入的数据格式保持一致。 + 你是一个数据分析师,你的任务是根据给定的数据进行数据预测,我将以json格式给你一组数据,你帮我预测之后的数据(一段可以展示趋势的数据,至少2个周期),用json数组的格式返回,返回的格式需要与传入的数据格式保持一致。 ```json 无法预测或者不支持预测的数据请直接返回(不需要返回JSON格式):"抱歉,该数据无法进行预测。(有原因则返回无法预测的原因)" diff --git a/frontend/src/views/chat/component/ChartComponent.vue b/frontend/src/views/chat/component/ChartComponent.vue index 706692c3..cdca076c 100644 --- a/frontend/src/views/chat/component/ChartComponent.vue +++ b/frontend/src/views/chat/component/ChartComponent.vue @@ -48,11 +48,11 @@ let chartInstance: BaseChart | undefined function renderChart() { chartInstance = getChartInstance(params.type, chartId.value) - console.log(chartInstance) if (chartInstance) { chartInstance.init(axis.value, params.data) chartInstance.render() } + console.debug(chartInstance) } function destroyChart() { diff --git a/frontend/src/views/chat/index.vue b/frontend/src/views/chat/index.vue index 18ca1879..998f510e 100644 --- a/frontend/src/views/chat/index.vue +++ b/frontend/src/views/chat/index.vue @@ -590,7 +590,7 @@ function getChatPredictData(recordId?: number) { chatApi.get_chart_predict_data(recordId).then((response) => { currentChat.value.records.forEach((record) => { if (record.id === recordId) { - record.predict_data = response.data ?? [] + record.predict_data = response ?? [] } }) })