Commit f04fa804fbefe1be32b4f0f78d8186d47bbb0686
Merge branch 'fix/DEFECT-1648' into 'main_dev'
fix: 修复短信发送支持json格式校验,如果没有校验则不能发送 See merge request yunteng/thingskit-front!923
Showing
2 changed files
with
21 additions
and
1 deletions
| @@ -37,7 +37,6 @@ | @@ -37,7 +37,6 @@ | ||
| 37 | const getBindProps = computed<Recordable>(() => { | 37 | const getBindProps = computed<Recordable>(() => { |
| 38 | const { value, apiTreeSelectProps = {} } = props; | 38 | const { value, apiTreeSelectProps = {} } = props; |
| 39 | const { params = {} } = apiTreeSelectProps; | 39 | const { params = {} } = apiTreeSelectProps; |
| 40 | - console.log(props, 'props'); | ||
| 41 | return { | 40 | return { |
| 42 | replaceFields: { children: 'children', key: 'id', title: 'name', value: 'id' }, | 41 | replaceFields: { children: 'children', key: 'id', title: 'name', value: 'id' }, |
| 43 | getPopupContainer: () => document.body, | 42 | getPopupContainer: () => document.body, |
| @@ -78,6 +78,27 @@ | @@ -78,6 +78,27 @@ | ||
| 78 | componentProps: { | 78 | componentProps: { |
| 79 | placeholder: '示例:{"code":"3654"}', | 79 | placeholder: '示例:{"code":"3654"}', |
| 80 | }, | 80 | }, |
| 81 | + dynamicRules: () => { | ||
| 82 | + return [ | ||
| 83 | + { | ||
| 84 | + required: true, | ||
| 85 | + validator: (_, value) => { | ||
| 86 | + try { | ||
| 87 | + if (typeof value == 'object') { | ||
| 88 | + return Promise.resolve(); | ||
| 89 | + } else { | ||
| 90 | + if (typeof JSON.parse(value) == 'object') { | ||
| 91 | + return Promise.resolve(); | ||
| 92 | + } | ||
| 93 | + return Promise.reject('请输入JSON格式例如{"code":"123"}'); | ||
| 94 | + } | ||
| 95 | + } catch { | ||
| 96 | + return Promise.reject('请输入JSON格式例如{"code":"123"}'); | ||
| 97 | + } | ||
| 98 | + }, | ||
| 99 | + }, | ||
| 100 | + ]; | ||
| 101 | + }, | ||
| 81 | }, | 102 | }, |
| 82 | { | 103 | { |
| 83 | field: 'remark', | 104 | field: 'remark', |