Commit fc63e5f9ac8c0700836a64b50460b83d0af1eec6
1 parent
ced6ead6
fix: DEFECT-834 not throw error message on submit
Showing
2 changed files
with
3 additions
and
3 deletions
| ... | ... | @@ -383,7 +383,7 @@ export const MediaTypeValidate: Rule[] = [ |
| 383 | 383 | required: true, |
| 384 | 384 | validator: (_, value: string) => { |
| 385 | 385 | const reg = /(?:.*)(?<=\.)/; |
| 386 | - const type = value.replace(reg, ''); | |
| 386 | + const type = (value || '').replace(reg, ''); | |
| 387 | 387 | if (type !== MediaType.M3U8) { |
| 388 | 388 | return Promise.reject('视频流只支持m3u8格式'); |
| 389 | 389 | } | ... | ... |
| ... | ... | @@ -173,8 +173,8 @@ export const formSchema: QFormSchema[] = [ |
| 173 | 173 | { |
| 174 | 174 | field: 'videoUrl', |
| 175 | 175 | label: '视频流', |
| 176 | - required: true, | |
| 177 | 176 | component: 'Input', |
| 177 | + required: true, | |
| 178 | 178 | ifShow({ values }) { |
| 179 | 179 | return values.accessMode === AccessMode.ManuallyEnter; |
| 180 | 180 | }, |
| ... | ... | @@ -182,7 +182,7 @@ export const formSchema: QFormSchema[] = [ |
| 182 | 182 | placeholder: '请输入视频流', |
| 183 | 183 | maxLength: 255, |
| 184 | 184 | }, |
| 185 | - rules: [...CameraVideoUrl, ...MediaTypeValidate, { required: true, message: '视频流是必填项' }], | |
| 185 | + rules: [{ required: true, message: '视频流是必填项' }, ...CameraVideoUrl, ...MediaTypeValidate], | |
| 186 | 186 | }, |
| 187 | 187 | |
| 188 | 188 | { | ... | ... |