diff --git a/src/utils/validate.js b/src/utils/validate.js index e820f838..5e4056f5 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -11,10 +11,6 @@ export function validUsername(str) { return valid_map.indexOf(str.trim()) >= 0 } -export function isExternal(path) { - return /^(https?:|mailto:|tel:)/.test(path) -} - /* 合法uri*/ export function validURL(url) { const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/