mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-06-22 14:13:49 +08:00
feat(account): polish reviews favorites and account UI
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
export const FALLBACK_ACCOUNT_CENTER_URL =
|
||||
"https://account.spark-app.store/account";
|
||||
|
||||
export const buildAccountFrameUrl = (
|
||||
baseUrl: string,
|
||||
username: string,
|
||||
): string => {
|
||||
let url: URL;
|
||||
|
||||
try {
|
||||
url = new URL(baseUrl);
|
||||
} catch {
|
||||
url = new URL(FALLBACK_ACCOUNT_CENTER_URL);
|
||||
}
|
||||
|
||||
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
||||
url = new URL(FALLBACK_ACCOUNT_CENTER_URL);
|
||||
}
|
||||
|
||||
const allowedParams = new URLSearchParams();
|
||||
allowedParams.set("view", "management");
|
||||
allowedParams.set("user", username);
|
||||
url.search = allowedParams.toString();
|
||||
|
||||
return url.toString();
|
||||
};
|
||||
Reference in New Issue
Block a user