Explorar o código

修改链接正则验证

zizhong.wang %!s(int64=4) %!d(string=hai) anos
pai
achega
82a380f533
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/views/data/components/UploadLinkEditModal.vue

+ 2 - 2
src/views/data/components/UploadLinkEditModal.vue

@@ -187,12 +187,12 @@ export default {
     },
     // 确认
     testUrl: function () {
-      var regex = /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?$/;
+      var regex = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\*\+,;=.]+$/;
       let flag = regex.test(this.mediaUrl);
       if (flag) {
         this.edit();
       } else {
-        alert("链接输入有误!\n示例:https://www.baidu.com");
+        alert("链接输入有误!\n示例:https://www.lexus.com");
       }
     },
     // 取消