diff options
-rw-r--r-- | src/locales/ru-RU.json | 1 | ||||
-rw-r--r-- | src/store/modules/Settings/SmtpStore.js | 5 | ||||
-rw-r--r-- | src/views/_sila/Settings/TransferInfo/Smtp.vue | 8 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/locales/ru-RU.json b/src/locales/ru-RU.json index a562a8f5..6eae5789 100644 --- a/src/locales/ru-RU.json +++ b/src/locales/ru-RU.json @@ -1157,6 +1157,7 @@ "description": "Настройте SNMP V2, SMTP и SYSLOG", "saveSmtpSuсcess": "Настройки SMTP успешно сохранены.", "saveSmtpError": "Ошибка сохранения настроек SMTP.", + "sendSmtpError": "Ошибка отправки сообщения.", "smtp": { "smtpTitle": "Настройки SMTP", "username": "Имя пользователя", diff --git a/src/store/modules/Settings/SmtpStore.js b/src/store/modules/Settings/SmtpStore.js index 6762fa27..4312ecd9 100644 --- a/src/store/modules/Settings/SmtpStore.js +++ b/src/store/modules/Settings/SmtpStore.js @@ -89,6 +89,11 @@ const SmtpStore = { async sendTestMessage(_, payload) { return await api .post('/redfish/v1/Smtp/SendMail', payload) + .then((res) => { + if (res.data.result === false) { + return res.data; + } + }) .catch((error) => console.log(error)); }, }, diff --git a/src/views/_sila/Settings/TransferInfo/Smtp.vue b/src/views/_sila/Settings/TransferInfo/Smtp.vue index 5934e9e5..37c576cf 100644 --- a/src/views/_sila/Settings/TransferInfo/Smtp.vue +++ b/src/views/_sila/Settings/TransferInfo/Smtp.vue @@ -373,7 +373,13 @@ export default { subject: 'Test Message', text: 'Test Message Text', }) - .then((message) => this.successToast(message)) + .then((message) => { + if (message.result === false) { + this.errorToast(this.$t('pageTransfer.sendSmtpError')); + } else { + this.successToast(message); + } + }) .catch(({ message }) => this.errorToast(message)); }, setForm() { |