完成预测功能2

master
ynmlzdwsp 11 months ago
parent 203e6bd789
commit e24a8a8883

@ -539,7 +539,7 @@ import {listTable1, predictReaction} from "@/utils/table1";
methods: { methods: {
/** 预测按钮操作 */ /** 预测按钮操作 */
handleQuery() { handleQuery() {
this.predictResult = ''; this.predictResult = '预测出错,请重试';
predictReaction(this.smiles1, this.smiles2) predictReaction(this.smiles1, this.smiles2)
.then(prediction => { .then(prediction => {
this.predictResult = prediction; this.predictResult = prediction;

@ -40,7 +40,7 @@ export function predictReaction(mol1, mol2) {
const url = 'http://127.0.0.1:5000/predict'; const url = 'http://127.0.0.1:5000/predict';
return axios.get(url, { params: { mol1, mol2 } }) return axios.get(url, { params: { mol1, mol2 } })
.then(response => Number(response.data)) .then(response => Number(response.data))
.catch(error => console.error(error)); .catch(error => {console.error(error);throw new Error('请求出错');}); // 抛出错误
} }

Loading…
Cancel
Save