@@ -198,7 +198,15 @@ const search = () => {
198198 searchLoading .value = false
199199 })
200200}
201-
201+ const splitString = (str : string ) => {
202+ if (typeof str !== ' string' ) {
203+ return []
204+ }
205+ return str
206+ .split (/ [,;] / )
207+ .map ((item ) => item .trim ())
208+ .filter ((item ) => item !== ' ' )
209+ }
202210const termFormRef = ref ()
203211const validateUrl = (_ : any , value : any , callback : any ) => {
204212 if (value === ' ' ) {
@@ -209,20 +217,15 @@ const validateUrl = (_: any, value: any, callback: any) => {
209217 )
210218 } else {
211219 // var Expression = /(https?:\/\/)?([\da-z\.-]+)\.([a-z]{2,6})(:\d{1,5})?([\/\w\.-]*)*\/?(#[\S]+)?/ // eslint-disable-line
212- value
213- .trim ()
214- .split (' ,' )
215- .forEach ((tempVal : string ) => {
216- var Expression = / ^ https? :\/\/ [^ \s /?#] + (:\d + )? / i
217- var objExp = new RegExp (Expression )
218- if (objExp .test (tempVal ) && ! tempVal .endsWith (' /' )) {
219- callback ()
220- } else {
221- callback (
222- t (' embedded.format_is_incorrect' , { msg: t (' embedded.domain_format_incorrect' ) })
223- )
224- }
225- })
220+ splitString (value ).forEach ((tempVal : string ) => {
221+ var Expression = / ^ https? :\/\/ [^ \s /?#] + (:\d + )? / i
222+ var objExp = new RegExp (Expression )
223+ if (objExp .test (tempVal ) && ! tempVal .endsWith (' /' )) {
224+ callback ()
225+ } else {
226+ callback (t (' embedded.format_is_incorrect' , { msg: t (' embedded.domain_format_incorrect' ) }))
227+ }
228+ })
226229 }
227230}
228231const rules = {
@@ -602,13 +605,10 @@ const copyCode = (row: any, key: any = 'app_secret') => {
602605 <el-form-item prop =" domain" :label =" t('embedded.cross_domain_settings')" >
603606 <el-input
604607 v-model =" pageForm.domain"
605- :placeholder ="
606- $t('datasource.please_enter') +
607- $t('common.empty') +
608- $t('embedded.cross_domain_settings')
609- "
608+ type =" textarea"
609+ :autosize =" { minRows: 2 }"
610+ :placeholder =" $t('embedded.third_party_address')"
610611 autocomplete =" off"
611- maxlength =" 50"
612612 clearable
613613 />
614614 </el-form-item >
0 commit comments