Update profile.js
This commit is contained in:
@@ -8,7 +8,10 @@ async function getProfileFromAnixart(profileId, token = '') {
|
||||
const response = await axios.get(url);
|
||||
const profileData = response.data;
|
||||
|
||||
let isVerified = false;
|
||||
// Убедимся, что profile существует
|
||||
if (!profileData.profile) {
|
||||
profileData.profile = {};
|
||||
}
|
||||
|
||||
// Проверка верификации
|
||||
try {
|
||||
@@ -16,11 +19,13 @@ async function getProfileFromAnixart(profileId, token = '') {
|
||||
const verifiedList = verifiedResponse.data;
|
||||
|
||||
if (Array.isArray(verifiedList) && verifiedList.includes(profileId.toString())) {
|
||||
isVerified = true;
|
||||
profileData.profile.is_verified = true;
|
||||
} else {
|
||||
profileData.profile.is_verified = false;
|
||||
}
|
||||
} catch {
|
||||
// Ошибку верификации игнорируем
|
||||
profileData.profile.is_verified = false;
|
||||
}
|
||||
|
||||
// Подгружаем кастомные роли
|
||||
@@ -36,14 +41,7 @@ async function getProfileFromAnixart(profileId, token = '') {
|
||||
// Ошибку загрузки ролей игнорируем
|
||||
}
|
||||
|
||||
// // Тестовое поле privilege_level (можно отключить)
|
||||
// profileData.profile.privilege_level = 0;
|
||||
// profileData.profile.status = "Я Falkor!";
|
||||
|
||||
return {
|
||||
...profileData,
|
||||
is_verified: isVerified,
|
||||
};
|
||||
return profileData;
|
||||
} catch {
|
||||
return {
|
||||
code: 2,
|
||||
|
||||
Reference in New Issue
Block a user