Skip to content

Commit bbd6862

Browse files
committed
feat(resource-manager): fix url validate rule
1 parent a089417 commit bbd6862

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

packages/plugins/resource/src/ResourceList.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,14 @@ export default {
249249
validator: ({ row }, value) => {
250250
const { type } = row
251251
return new Promise((resolve, reject) => {
252-
if (type === 'url' && !value) {
253-
reject(new Error('资源URL必填'))
254-
} else if (!/^(http|https):\/\/[^\s]+(\.png|\.jpg|\.jpeg|\.svg)$/.test(value)) {
255-
reject(new Error('URL须以http或https开头,以文件后缀名结尾'))
256-
} else {
257-
resolve()
252+
if (type === 'url') {
253+
if (!value) {
254+
reject(new Error('资源URL必填'))
255+
} else if (!/^(http|https):\/\/[^\s]+(\.png|\.jpg|\.jpeg|\.svg)$/.test(value)) {
256+
reject(new Error('URL须以http或https开头,以文件后缀名结尾'))
257+
}
258258
}
259+
resolve()
259260
})
260261
}
261262
}

0 commit comments

Comments
 (0)