diff --git a/client/shared/model/user.ts b/client/shared/model/user.ts index b6e0d79a..92ae0605 100644 --- a/client/shared/model/user.ts +++ b/client/shared/model/user.ts @@ -5,6 +5,7 @@ import { SYSTEM_USERID } from '../utils/consts'; import { createAutoMergedRequest } from '../utils/request'; import _pick from 'lodash/pick'; import { t } from '../i18n'; +import { parseUrlStr } from '../utils/url-helper'; export interface UserBaseInfo { _id: string; @@ -214,6 +215,10 @@ export async function fetchUserInfo(userId: string): Promise { const userInfo = await _fetchUserInfo(userId); + if (userInfo && userInfo.avatar) { + userInfo.avatar = parseUrlStr(userInfo.avatar); // 用户信息从来源支持常量替换 + } + return userInfo; }