Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

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

Open
wants to merge 1 commit into
base: ruoli
Choose a base branch
from

Conversation

cha0sCat
Copy link

@cha0sCat cha0sCat commented Aug 26, 2021

主要解决了两个问题

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

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

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant