fixed a path bug in lite

This commit is contained in:
Concedo 2024-05-16 10:40:00 +08:00
parent 6d9d846bdd
commit 51aa32b928

View file

@ -3933,10 +3933,10 @@ Current version: 138
const twoslashes = /\/[^/]+\/[^/]*$/; const twoslashes = /\/[^/]+\/[^/]*$/;
if(window.location.protocol != 'file:' && pn!="" && pn!="/" && twoslashes.test(pn)) if(window.location.protocol != 'file:' && pn!="" && pn!="/" && twoslashes.test(pn))
{ {
const segments = pathname.split('/').filter(segment => segment.length > 0); const segments = pn.split('/').filter(segment => segment.length > 0);
for(let i=0;i<segments.length;++i) for(let i=0;i<segments.length;++i)
{ {
if(!pathname.endsWith("/") && (i==segments.length-1)) if(!pn.endsWith("/") && (i==segments.length-1))
{ {
break; break;
} }