imatrix-ui 2.9.68-dw → 2.9.69-dw
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -160,7 +160,21 @@ export default {
|
|
|
160
160
|
tinymce.activeEditor && tinymce.activeEditor.uploadImages()
|
|
161
161
|
return url
|
|
162
162
|
}
|
|
163
|
-
|
|
163
|
+
// 正则表达式,用于验证URL
|
|
164
|
+
const urlPattern = new RegExp(
|
|
165
|
+
'^(https?:\\/\\/)?' + // 协议 http:// 或者 https:// (可选)
|
|
166
|
+
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // 域名
|
|
167
|
+
'((\\d{1,3}\\.){3}\\d{1,3}))' + // 或者 IP (v4) 地址
|
|
168
|
+
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // 端口号(可选)
|
|
169
|
+
'(\\?[;&a-z\\d%_.~+=-]*)?' + // 查询字符串(可选)
|
|
170
|
+
'(\\#[-a-z\\d_]*)?$', 'i') // 片段(可选)
|
|
171
|
+
|
|
172
|
+
if (urlPattern.test(url)) {
|
|
173
|
+
return url
|
|
174
|
+
} else {
|
|
175
|
+
alert('url invalid')
|
|
176
|
+
return ''
|
|
177
|
+
}
|
|
164
178
|
},
|
|
165
179
|
images_upload_handler: (blobInfo, success, failure, progress) => {
|
|
166
180
|
let file
|