Merge branch 'dev'
This commit is contained in:
commit
c651b51864
|
|
@ -323,13 +323,19 @@ function _isSubdomain(): boolean {
|
||||||
const p = window.location.host.split(":")[0].split(".");
|
const p = window.location.host.split(":")[0].split(".");
|
||||||
return p.length >= 3 && p.slice(-2).join(".") === "rspace.online" && !_RESERVED.includes(p[0]);
|
return p.length >= 3 && p.slice(-2).join(".") === "rspace.online" && !_RESERVED.includes(p[0]);
|
||||||
}
|
}
|
||||||
|
function _isBareDomain(): boolean {
|
||||||
|
const h = window.location.host.split(":")[0];
|
||||||
|
return h === "rspace.online" || h === "www.rspace.online";
|
||||||
|
}
|
||||||
function _getCurrentSpace(): string {
|
function _getCurrentSpace(): string {
|
||||||
if (_isSubdomain()) return window.location.host.split(":")[0].split(".")[0];
|
if (_isSubdomain()) return window.location.host.split(":")[0].split(".")[0];
|
||||||
|
if (_isBareDomain()) return "demo";
|
||||||
return window.location.pathname.split("/").filter(Boolean)[0] || "demo";
|
return window.location.pathname.split("/").filter(Boolean)[0] || "demo";
|
||||||
}
|
}
|
||||||
function _getCurrentModule(): string {
|
function _getCurrentModule(): string {
|
||||||
const parts = window.location.pathname.split("/").filter(Boolean);
|
const parts = window.location.pathname.split("/").filter(Boolean);
|
||||||
return _isSubdomain() ? (parts[0] || "rspace") : (parts[1] || "rspace");
|
if (_isSubdomain() || _isBareDomain()) return parts[0] || "rspace";
|
||||||
|
return parts[1] || "rspace";
|
||||||
}
|
}
|
||||||
function _navUrl(space: string, moduleId: string): string {
|
function _navUrl(space: string, moduleId: string): string {
|
||||||
const h = window.location.host.split(":")[0].split(".");
|
const h = window.location.host.split(":")[0].split(".");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue