fix: preserve KOC portal path in delegation links
This commit is contained in:
@@ -543,7 +543,9 @@ export default function Home() {
|
||||
};
|
||||
|
||||
const delegationUrl = (shareToken: string) => {
|
||||
const url = new URL(window.location.origin);
|
||||
const url = new URL(window.location.href);
|
||||
url.search = "";
|
||||
url.hash = "";
|
||||
url.searchParams.set("share", shareToken);
|
||||
return url.toString();
|
||||
};
|
||||
|
||||
@@ -129,6 +129,9 @@ test("creates anonymous delegation bundles and reuses one-to-one backfill", asyn
|
||||
assert.match(page, /action:\s*"revoke_delegation"/);
|
||||
assert.match(page, /合作社转派 · 无需登录/);
|
||||
assert.match(page, /"X-KOC-Delegation"/);
|
||||
assert.match(page, /const url = new URL\(window\.location\.href\)/);
|
||||
assert.match(page, /url\.search = ""/);
|
||||
assert.doesNotMatch(page, /const url = new URL\(window\.location\.origin\)/);
|
||||
assert.match(page, /url\.searchParams\.set\("share", shareToken\)/);
|
||||
assert.match(page, /请保存当前分享链接/);
|
||||
assert.doesNotMatch(page, /底层KOC手机号|底层KOC企微|底层KOC微信/);
|
||||
|
||||
Reference in New Issue
Block a user