优化isHttp方法判断是否为null情况

This commit is contained in:
不做码农 2022-09-29 21:47:42 +08:00
parent 11aba72476
commit ea8258ce5f

View File

@ -4,8 +4,11 @@
* @returns {Boolean} * @returns {Boolean}
*/ */
export function isHttp(url) { export function isHttp(url) {
if (url) {
return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1 return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1
} }
return false
}
/** /**
* 判断path是否为外链 * 判断path是否为外链