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; }
|
get code(): string { return this._code; }
|
||||||
set code(c: string) {
|
set code(c: string) {
|
||||||
this._code = c;
|
this._code = c;
|
||||||
|
|
||||||
|
|
||||||
let u = new URL(window.location.href);
|
let u = new URL(window.location.href);
|
||||||
let path = u.pathname;
|
const path = window.pages.Base + window.pages.Form + "/" + this._code;
|
||||||
for (let split of ["account", "my"]) {
|
|
||||||
path = path.split(split)[0];
|
|
||||||
}
|
|
||||||
if (path.slice(-1) != "/") { path += "/"; }
|
|
||||||
path = path + window.pages.Form + "/" + this._code;
|
|
||||||
|
|
||||||
u.pathname = path;
|
u.pathname = path;
|
||||||
u.hash = "";
|
u.hash = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user