完善个人页(测试NTRP水平未做)
This commit is contained in:
@@ -28,6 +28,9 @@ interface UserDetailData {
|
||||
last_login_time: string;
|
||||
create_time: string;
|
||||
last_modify_time: string;
|
||||
personal_profile: string;
|
||||
occupation: string;
|
||||
birthday: string;
|
||||
stats: {
|
||||
followers_count: number;
|
||||
following_count: number;
|
||||
@@ -226,12 +229,13 @@ export class UserService {
|
||||
participated: userData.stats?.participated_games_count || 0
|
||||
},
|
||||
|
||||
personal_profile: '',
|
||||
personal_profile: userData.personal_profile || '',
|
||||
location: userData.city + userData.district|| '',
|
||||
occupation: '',
|
||||
occupation: userData.occupation || '',
|
||||
ntrp_level: '',
|
||||
phone: userData.phone || '',
|
||||
gender: userData.gender || ''
|
||||
gender: userData.gender || '',
|
||||
birthday: userData.birthday || '',
|
||||
};
|
||||
} else {
|
||||
throw new Error(response.message || '获取用户信息失败');
|
||||
@@ -449,6 +453,24 @@ export class UserService {
|
||||
return require('../static/userInfo/default_avatar.svg');
|
||||
}
|
||||
}
|
||||
|
||||
// 解析用户手机号
|
||||
static async parse_phone(phone_code: string): Promise<string> {
|
||||
try {
|
||||
const response = await httpService.post<{ phone: string }>(API_CONFIG.USER.PARSE_PHONE, { phone_code }, {
|
||||
showLoading: true,
|
||||
loadingText: '获取手机号中...'
|
||||
});
|
||||
if (response.code === 0) {
|
||||
return response.data.phone || '';
|
||||
} else {
|
||||
throw new Error(response.message || '获取手机号失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取手机号失败:', error);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 从 loginService 移过来的用户相关方法
|
||||
|
||||
Reference in New Issue
Block a user