userpage: fix invite code gen
as the admin page, use window.pages to generate link entirely.
This commit is contained in:
+3
-7
@@ -303,14 +303,10 @@ class ReferralCard {
|
||||
get code(): string { return this._code; }
|
||||
set code(c: string) {
|
||||
this._code = c;
|
||||
|
||||
|
||||
|
||||
let u = new URL(window.location.href);
|
||||
let path = u.pathname;
|
||||
for (let split of ["account", "my"]) {
|
||||
path = path.split(split)[0];
|
||||
}
|
||||
if (path.slice(-1) != "/") { path += "/"; }
|
||||
path = path + window.pages.Form + "/" + this._code;
|
||||
const path = window.pages.Base + window.pages.Form + "/" + this._code;
|
||||
|
||||
u.pathname = path;
|
||||
u.hash = "";
|
||||
|
||||
Reference in New Issue
Block a user