support sub path
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
export function getBasePath(): string {
|
||||
const path = window.location.pathname;
|
||||
const lastSlashIndex = path.lastIndexOf('/');
|
||||
|
||||
if (lastSlashIndex < 0) {
|
||||
return path;
|
||||
}
|
||||
|
||||
return path.substring(0, lastSlashIndex);
|
||||
}
|
||||
Reference in New Issue
Block a user