浏览代码

清除药品说明输添加容错

zhangxc 6 年之前
父节点
当前提交
2347f3dad9
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/store/actions/treat.js

+ 2 - 1
src/store/actions/treat.js

@@ -61,7 +61,8 @@ export const setDrugInfo = (state, action) => {
 
 export const clearDrugInfo = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
-    res.drugInfo.drugDesc = [];
+    // res.drugInfo.drugDesc = [];
+    if (res.drugInfo && res.drugInfo.drugDesc) { res.drugInfo.drugDesc = [];}
     return res
 }