var value = "https://www.baidu.com/20210922/95b22ab5034b2d0f.jpg";
const str = value.split("https://"); //https://进行分割,
const index = str[1].indexOf("/")+1; //indexOf 获取第一个斜杠的索引,
console.log(str[1].substring(index)); //substring 截取,
//获取前面的域名
var i = "https://www.baidu.com/20210922/95b22ab5034b2d0f.jpg";
console.log(i.match(/^(?:[^/]|//)*/));