This commit is contained in:
Lizandro Guarnizo
2026-05-16 21:54:17 -05:00
parent 65f35fbc51
commit 4b2003c752
7 changed files with 179 additions and 5 deletions
+4 -4
View File
@@ -489,19 +489,19 @@ function miCuenta() {
this.tg.verificando = true;
this.tg.verMsg = '';
try {
const r = await axios.get('/portal/mi-perfil/telegram-status');
if (r.data.linked) {
const r = await axios.post('/portal/mi-perfil/telegram-validar');
if (r.data.ok) {
this.tg.linked = true;
this.tg.chat_id = r.data.chat_id;
this.tg.token = '';
this.tg.verMsg = '✅ ¡Telegram vinculado correctamente!';
this.tg.verOk = true;
} else {
this.tg.verMsg = 'Aún no se detectó el mensaje. Asegúrate de enviar el código al bot.';
this.tg.verMsg = r.data.error || 'No se encontró el mensaje. Envía /vincular ' + this.tg.token + ' al bot.';
this.tg.verOk = false;
}
} catch(e) {
this.tg.verMsg = 'Error al verificar. Intenta de nuevo.';
this.tg.verMsg = e.response?.data?.error || 'Error al verificar. Intenta de nuevo.';
this.tg.verOk = false;
} finally { this.tg.verificando = false; }
},