Browse Source

fix: 接口报错提示

master
guoapeng 1 week ago
parent
commit
5744fe2506
  1. 2
      src/apis/system.ts
  2. 2
      src/components/formula/FormulaConfig.vue

2
src/apis/system.ts

@ -1,3 +1,4 @@
import { FtMessage } from 'libs/message'
import { createWebSocket } from 'libs/socket' import { createWebSocket } from 'libs/socket'
import { nanoid } from 'nanoid' import { nanoid } from 'nanoid'
@ -20,6 +21,7 @@ export async function sendCmd(resParams: System.SendCmdParams) {
return res.rely return res.rely
} }
else { else {
FtMessage.error(`错误码: ${res.ackcode}, 描述: ${res.message}`)
console.log(res) console.log(res)
throw new Error(res.message) throw new Error(res.message)
} }

2
src/components/formula/FormulaConfig.vue

@ -112,7 +112,7 @@ const handleSubmit = async () => {
ElMessage.warning('禁止修改正在执行的配方信息!') ElMessage.warning('禁止修改正在执行的配方信息!')
return return
} }
const formulaForm: Record<string, any> = convertValuesToString(formData.value, 'name')
const formulaForm: Record<string, any> = convertValuesToString(formData.value, 'name').filter()
formulaStore formulaStore
.editFormula(formulaForm.formula_id, formulaForm as Formula.FormulaItem) .editFormula(formulaForm.formula_id, formulaForm as Formula.FormulaItem)
.then(() => { .then(() => {

Loading…
Cancel
Save