auto-submit icon indicating copy to clipboard operation
auto-submit copied to clipboard

refactor(collection): 解决了 fieldType 原始类型为 string 导致问题类型判断不成功的问题

Open cha0sCat opened this issue 3 years ago • 0 comments

主要解决了两个问题

formItem['isRequired'] 原始类型变为 Boolean 导致 formItem['isRequired'] == 1 无法正确判断问题是否必填 这会导致所有问题都被忽略

以及 formItem['fieldType'] 原始类型为 String 导致 if formItem['fieldType'] == 1 or formItem['fieldType'] == 5: 问题类型判断失效 这会导致单选题被多选上传(未能正确进入对应代码块),非常严重

顺便,源代码在遍历 list 的同时修改了 list 的内容,这是十分危险的,因此顺便重构了一下,增强了鲁棒性

cha0sCat avatar Aug 26 '21 07:08 cha0sCat