feat: новая функция
This commit is contained in:
@@ -491,7 +491,12 @@ async function handleAiReply() {
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Ошибка генерации ответа ИИ:', e);
|
||||
alert('Ошибка генерации ответа ИИ');
|
||||
// Используем более дружелюбное уведомление вместо alert
|
||||
emit('error', {
|
||||
type: 'ai-generation-error',
|
||||
message: 'Не удалось сгенерировать ответ ИИ. Попробуйте еще раз.',
|
||||
details: e.message
|
||||
});
|
||||
} finally {
|
||||
isAiLoading.value = false;
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ async function handleSendMessage({ message, attachments }) {
|
||||
if (typeof ElMessageBox === 'function') {
|
||||
ElMessageBox.alert('Пользователь заблокирован. Отправка сообщений невозможна.', 'Ошибка', { type: 'error' });
|
||||
} else {
|
||||
alert('Пользователь заблокирован. Отправка сообщений невозможна.');
|
||||
console.error('Пользователь заблокирован. Отправка сообщений невозможна.');
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -441,7 +441,7 @@ async function handleSendMessage({ message, attachments }) {
|
||||
if (typeof ElMessageBox === 'function') {
|
||||
ElMessageBox.alert('У пользователя нет ни одного идентификатора (email, telegram, wallet). Сообщение не может быть отправлено.', 'Ошибка', { type: 'warning' });
|
||||
} else {
|
||||
alert('У пользователя нет ни одного идентификатора (email, telegram, wallet). Сообщение не может быть отправлено.');
|
||||
console.error('У пользователя нет ни одного идентификатора (email, telegram, wallet). Сообщение не может быть отправлено.');
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -464,14 +464,14 @@ async function handleSendMessage({ message, attachments }) {
|
||||
if (typeof ElMessageBox === 'function') {
|
||||
ElMessageBox.alert(resultText, 'Результат рассылки', { type: 'info' });
|
||||
} else {
|
||||
alert(resultText);
|
||||
console.log('Результат рассылки:', resultText);
|
||||
}
|
||||
await loadMessages();
|
||||
} catch (e) {
|
||||
if (typeof ElMessageBox === 'function') {
|
||||
ElMessageBox.alert('Ошибка отправки: ' + (e?.response?.data?.error || e?.message || e), 'Ошибка', { type: 'error' });
|
||||
} else {
|
||||
alert('Ошибка отправки: ' + (e?.response?.data?.error || e?.message || e));
|
||||
console.error('Ошибка отправки:', e?.response?.data?.error || e?.message || e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user