@@ -157,7 +157,16 @@ const handleBaseEmbedded = (row: any) => {
157157const handleAdvancedEmbedded = (row : any ) => {
158158 advancedApplication .value = true
159159 if (row ) {
160- Object .assign (urlForm , cloneDeep (JSON .parse (row .configuration )))
160+ const tempData = cloneDeep (JSON .parse (row .configuration ))
161+ if (tempData ?.endpoint .startsWith (' http' )) {
162+ row .domain
163+ .trim ()
164+ .split (' ,' )
165+ .forEach ((domain : string ) => {
166+ tempData .endpoint = tempData .endpoint .replace (domain , ' ' )
167+ })
168+ }
169+ Object .assign (urlForm , tempData )
161170 }
162171 ruleConfigvVisible .value = true
163172 dialogTitle .value = row ?.id
@@ -265,13 +274,20 @@ const validateUrl = (_: any, value: any, callback: any) => {
265274 )
266275 } else {
267276 // var Expression = /(https?:\/\/)?([\da-z\.-]+)\.([a-z]{2,6})(:\d{1,5})?([\/\w\.-]*)*\/?(#[\S]+)?/ // eslint-disable-line
268- var Expression = / ^ https? :\/\/ [^ \s /?#] + (:\d + )? / i
269- var objExp = new RegExp (Expression )
270- if (objExp .test (value ) && ! value .endsWith (' /' )) {
271- callback ()
272- } else {
273- callback (t (' embedded.format_is_incorrect' ))
274- }
277+ value
278+ .trim ()
279+ .split (' ,' )
280+ .forEach ((tempVal : string ) => {
281+ var Expression = / ^ https? :\/\/ [^ \s /?#] + (:\d + )? / i
282+ var objExp = new RegExp (Expression )
283+ if (objExp .test (tempVal ) && ! tempVal .endsWith (' /' )) {
284+ callback ()
285+ } else {
286+ callback (
287+ t (' embedded.format_is_incorrect' , { msg: t (' embedded.domain_format_incorrect' ) })
288+ )
289+ }
290+ })
275291 }
276292}
277293const rules = {
@@ -307,12 +323,13 @@ const validatePass = (_: any, value: any, callback: any) => {
307323 )
308324 } else {
309325 // var Expression = /(https?:\/\/)?([\da-z\.-]+)\.([a-z]{2,6})(:\d{1,5})?([\/\w\.-]*)*\/?(#[\S]+)?/ // eslint-disable-line
310- var Expression = / ^ https? :\/\/ [^ \s /?#] + (:\d + )? / i
326+ // var Expression = /^https?:\/\/[^\s/?#]+(:\d+)?/i
327+ var Expression = / ^ \/ ([a-zA-Z0-9 _-] + \/ )* [a-zA-Z0-9 _-] + (\? [a-zA-Z0-9 _=&-] + )? $ /
311328 var objExp = new RegExp (Expression )
312- if (objExp .test (value ) && value . startsWith ( currentEmbedded . domain ) ) {
329+ if (objExp .test (value )) {
313330 callback ()
314331 } else {
315- callback (t (' embedded.format_is_incorrect' ))
332+ callback (t (' embedded.format_is_incorrect' , { msg: t ( ' embedded.interface_url_incorrect ' ) } ))
316333 }
317334 }
318335}
0 commit comments