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,7 +383,7 @@ export const MediaTypeValidate: Rule[] = [ | ||
| 383 | required: true, | 383 | required: true, |
| 384 | validator: (_, value: string) => { | 384 | validator: (_, value: string) => { |
| 385 | const reg = /(?:.*)(?<=\.)/; | 385 | const reg = /(?:.*)(?<=\.)/; |
| 386 | - const type = value.replace(reg, ''); | 386 | + const type = (value || '').replace(reg, ''); |
| 387 | if (type !== MediaType.M3U8) { | 387 | if (type !== MediaType.M3U8) { |
| 388 | return Promise.reject('视频流只支持m3u8格式'); | 388 | return Promise.reject('视频流只支持m3u8格式'); |
| 389 | } | 389 | } |
| @@ -173,8 +173,8 @@ export const formSchema: QFormSchema[] = [ | @@ -173,8 +173,8 @@ export const formSchema: QFormSchema[] = [ | ||
| 173 | { | 173 | { |
| 174 | field: 'videoUrl', | 174 | field: 'videoUrl', |
| 175 | label: '视频流', | 175 | label: '视频流', |
| 176 | - required: true, | ||
| 177 | component: 'Input', | 176 | component: 'Input', |
| 177 | + required: true, | ||
| 178 | ifShow({ values }) { | 178 | ifShow({ values }) { |
| 179 | return values.accessMode === AccessMode.ManuallyEnter; | 179 | return values.accessMode === AccessMode.ManuallyEnter; |
| 180 | }, | 180 | }, |
| @@ -182,7 +182,7 @@ export const formSchema: QFormSchema[] = [ | @@ -182,7 +182,7 @@ export const formSchema: QFormSchema[] = [ | ||
| 182 | placeholder: '请输入视频流', | 182 | placeholder: '请输入视频流', |
| 183 | maxLength: 255, | 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 | { |