From e24a8a8883913810f2991d52bf7339d0f29a4fa1 Mon Sep 17 00:00:00 2001 From: ynmlzdwsp <2727940448@qq.com> Date: Sun, 7 Jan 2024 15:21:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=A2=84=E6=B5=8B=E5=8A=9F?= =?UTF-8?q?=E8=83=BD2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/love.vue | 2 +- src/utils/table1.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/love.vue b/src/components/love.vue index d6b4269..cef092d 100644 --- a/src/components/love.vue +++ b/src/components/love.vue @@ -539,7 +539,7 @@ import {listTable1, predictReaction} from "@/utils/table1"; methods: { /** 预测按钮操作 */ handleQuery() { - this.predictResult = ''; + this.predictResult = '预测出错,请重试'; predictReaction(this.smiles1, this.smiles2) .then(prediction => { this.predictResult = prediction; diff --git a/src/utils/table1.js b/src/utils/table1.js index 5a9e279..33a5bcf 100644 --- a/src/utils/table1.js +++ b/src/utils/table1.js @@ -40,7 +40,7 @@ export function predictReaction(mol1, mol2) { const url = 'http://127.0.0.1:5000/predict'; return axios.get(url, { params: { mol1, mol2 } }) .then(response => Number(response.data)) - .catch(error => console.error(error)); + .catch(error => {console.error(error);throw new Error('请求出错');}); // 抛出错误 }