Fix getURI() return http://xx.xx.xx// bug.

This commit is contained in:
Kenshin 2017-01-05 10:16:37 +08:00
parent 371869c0a7
commit d7e8d4cc08

View File

@ -140,8 +140,8 @@ function getURI() {
const pathname = window.location.pathname,
arr = pathname.split( "/" ),
end = arr.pop(),
str = arr.join( "" );
return `${ window.location.protocol }//${ window.location.hostname }/${ str }/`;
str = arr.join( "" ) === "" ? arr.join( "" ) : arr.join( "" ) + "/";
return `${ window.location.protocol }//${ window.location.hostname }/${ str }`;
}
/**