feat(auth): 用户账户 - 完善个人资料与登录日志 (#752)
Co-authored-by: wuligao <1247662379@qq.com>
This commit is contained in:
1 parent
e70fe1b9c9
commit
4c1d2b4012
83 files changed
+5836
-328
No files matched your search
@@ -0,0 +1,8 @@
|
||||
// Profile responses use a canonical /api path; deployment routing belongs to
|
||||
// the configured API base, including its origin and reverse-proxy prefix.
|
||||
export function resolveUserAvatarURL(candidate: string | undefined, apiBaseURL: string): string {
|
||||
if (!candidate) return "";
|
||||
if (/^https?:\/\//i.test(candidate)) return candidate;
|
||||
if (!/^\/api\/auth\/profile\/avatar\/[a-zA-Z0-9_-]+\?v=[a-zA-Z0-9_-]+$/.test(candidate)) return "";
|
||||
return `${apiBaseURL.replace(/\/+$/, "")}${candidate.slice("/api".length)}`;
|
||||
}
|
||||
Reference in new issue
Block a user