快乐的昕的电脑
2025-10-20 2885a97a79ce0ac8ef69ac3f978e3814376c4552
优化报错逻辑
已修改1个文件
36 ■■■■■ 文件已修改
components/mold.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/mold.vue
@@ -275,18 +275,12 @@
                        headers: { 'Content-Type': 'application/json' }
                    });
                    if (res.data && res.data.outMsg) {
                        if (res.data.outMsg === '重复上下刀') {
                            uni.showToast({
                                title: res.data.outMsg,
                                icon: 'error'
                            });
                            return; // 报错时不再继续
                        } else {
                            uni.showToast({
                                title: res.data.outMsg,
                                icon: 'none'
                            });
                        }
                        const isRepeat = res.data.outMsg === '重复上下刀';
                        uni.showToast({
                            title: res.data.outMsg,
                            icon: isRepeat ? 'error' : 'none'
                        });
                        if (isRepeat) return; // 报错时不再继续
                    } else if (res.status === 0) {
                        uni.showToast({
                            title: '下刀提交成功',
@@ -336,18 +330,12 @@
                        headers: { 'Content-Type': 'application/json' }
                    });
                    if (res.data && res.data.outMsg) {
                        if (res.data.outMsg === '重复上下刀') {
                            uni.showToast({
                                title: res.data.outMsg,
                                icon: 'error'
                            });
                            return; // 报错时不再继续
                        } else {
                            uni.showToast({
                                title: res.data.outMsg,
                                icon: 'none'
                            });
                        }
                        const isRepeat = res.data.outMsg === '重复上下刀';
                        uni.showToast({
                            title: res.data.outMsg,
                            icon: isRepeat ? 'error' : 'none'
                        });
                        if (isRepeat) return; // 报错时不再继续
                    } else if (res.status === 0) {
                        uni.showToast({
                            title: '下刀提交成功',