直接上方法了
'https://old.xhcss.com/xh/dedecms/mark/'.replace(/^https?:\/\/[^/]+/, ""); // => /xh/dedecms/mark/ 'https://old.xhcss.com/xh/dedecms/mark/'.replace(/^https?:\/\/[^/]+\//, "");// => xh/dedecms/mark/'
直接上方法了
'https://old.xhcss.com/xh/dedecms/mark/'.replace(/^https?:\/\/[^/]+/, ""); // => /xh/dedecms/mark/ 'https://old.xhcss.com/xh/dedecms/mark/'.replace(/^https?:\/\/[^/]+\//, "");// => xh/dedecms/mark/'