Browse Source

alterações nas request

pull/3/head
Lucas Awade 2 years ago
parent
commit
e29c650a67
  1. 7
      index.php
  2. 4
      public/js/config.js
  3. 4
      public/js/cronometro.js
  4. 162
      public/js/main.js
  5. 77
      public/js/requests.js
  6. 26
      public/js/util.js

7
index.php

@ -39,18 +39,11 @@ if ($geturl['t'] == 'gerar' && $post['passwd'] == 'S1MPL3S1P_CH4T') {
if ($geturl['t']) {
$json = json_decode($crypt->decrypt(str_replace(' ', '+', $geturl['t'])), true);
$objs = [
<<<<<<< HEAD
'id_empresa' => $json['id_empresa'],
'obj_server' => $json['servidor'],
'my_uniqueid' => $json['matricula'],
'obj_queue' => $json['fila'],
=======
'id_number' => $json['id_number'],
'id_empresa' => $json['id_empresa'],
'obj_server' => $json['servidor'],
'my_uniqueid' => $json['matricula'],
'obj_queue' => $json['fila'],
>>>>>>> 1e181ff (ajustes de funcionalidades)
'obj_ws' => $json['websocket'],
'session_uniqueid' => null,
'obj_notification' => null,

4
public/js/config.js

@ -1,10 +1,6 @@
const ws = localStorage.getItem('obj_ws')
<<<<<<< HEAD
const server_api = localStorage.getItem('obj_server')
=======
const server_api = `http://${localStorage.getItem('obj_server')}`
const supervisor_api = localStorage.getItem('supervisor_api') ? localStorage.getItem('supervisor_api') : localStorage.getItem('obj_server')
>>>>>>> 1e181ff (ajustes de funcionalidades)
let mediaRecorder
const icontypes = ['csv', 'doc', 'pdf', 'txt', 'xls', 'zip', 'ppt']
const path = 'public'

4
public/js/cronometro.js

@ -47,8 +47,8 @@ function converdata(timestamp, horario_server = false){
}
let date = new Date(timestamp);
let day = addZero(date.getDay())
let month = addZero(date.getMonth())
let day = addZero(date.getDate())
let month = addZero(date.getMonth() + 1)
let hours = date.getHours();
let minutes = date.getMinutes();
let formattedTime = `${day}/${month} ` + addZero(hours) + ':' + addZero(minutes)

162
public/js/main.js

@ -1,7 +1,7 @@
/**
* EVENTOS GERADOS PELO USUARIO DA APLICACAO
*/
$(function(){
$(function () {
connect(ws)
notifications()
/**
@ -18,7 +18,7 @@ $(function(){
/** FIM VOICE RECORDER */
/** EVENTOS DE CLICK NO BODY */
$("body").mouseup(function(){
$("body").mouseup(function () {
$('#uploadfiles').fadeOut('slow')
});
@ -34,33 +34,33 @@ $(function(){
startChannelMessage()
/** INICIA O CHAT NO FINAL DA CONVERSA */
$('.chats').on('click', function(){
$('.chats').on('click', function () {
scrollDown()
})
/** ENVIA AS MSG PELO ENTER */
$('#fieldsendmessage').bind('keyup', function(ev){
if(ev.keyCode == 13 && $(this).val().trim().length > 0){
$('#fieldsendmessage').bind('keyup', function (ev) {
if (ev.keyCode == 13 && $(this).val().trim().length > 0) {
sendMessage()
}
})
$('#fieldsendmessage').on('keyup', () => {
if($(this).val().trim().length == 0){
if ($(this).val().trim().length == 0) {
$(this).val('')
}
resizeSendMsg()
})
$('.type-message-bar-right').on('click',() => {
$('.type-message-bar-right').on('click', () => {
sendMessage()
})
$('#imgclip').on('click', function(){
$('#imgclip').on('click', function () {
modalStart()
$("#uploadimage").val('')
$('#uploadfile').val('')
if($('#uploadfiles').is(':hidden')){
if ($('#uploadfiles').is(':hidden')) {
$('#uploadfiles').fadeIn('slow')
} else {
$('#uploadfiles').fadeOut('slow')
@ -69,10 +69,10 @@ $(function(){
$('#footer-content-right').on('click', '#footersend', () => {
sendMedia(mediaRecorder)
$('#modalselect').css({display: 'none'})
$('#modalselect').css({ display: 'none' })
})
supervisorAgente()
})
/**
@ -82,7 +82,7 @@ $(function(){
const selectNotification = (id) => {
marcarMensagemVista(id)
listaMensagem(id).then(() => {
listaMensagem(id).then(async () => {
let uniqueid
let number
let name
@ -90,41 +90,35 @@ const selectNotification = (id) => {
let protocolo
const dataRequest = JSON.parse(localStorage.getItem('obj_contact'))
<<<<<<< HEAD
listarAtendimentoAgente(localStorage.getItem('my_uniqueid'))
=======
listarAtendimentoAgente(localStorage.getItem('id_empresa'), localStorage.getItem('my_uniqueid'))
>>>>>>> 1e181ff (ajustes de funcionalidades)
const allNotifications = JSON.parse(localStorage.getItem('obj_notification'))
const atendimentos = await buscarAtendimento(id);
console.log(allNotifications)
hideButtons(false)
allNotifications.data.forEach(e => {
$('#' + e.uniqueid.replace('.', `\\.`)).removeClass('select-notification')
if(e.uniqueid == id && e.status == 0){
if (e.uniqueid == id && e.status == 0) {
hideButtons(true)
}
})
$('#' + id.replace('.', `\\.`)).addClass('select-notification')
allNotifications.data.forEach(e => {
if(e.uniqueid == id && e.status == 0){
if (e.uniqueid == id && e.status == 0) {
hideButtons(true)
}
})
if(dataRequest.data.length > 0){
if (dataRequest.data.length > 0) {
dataContact = dataRequest.data.filter(e => {
if(id.trim() == e.uniqueid){
if (id.trim() == e.uniqueid) {
return true
}
})
}
allNotifications.data.forEach(e => {
if(id === e.uniqueid){
if (id === e.uniqueid) {
uniqueid = e.uniqueid
name = e.nome
number = e.cliente_id
@ -136,25 +130,21 @@ const selectNotification = (id) => {
localStorage.removeItem('session_uniqueid')
localStorage.setItem('session_uniqueid', uniqueid)
localStorage.setItem('session_window', number)
$('.chat-window-contact-name').text(name)
$('.chat-window-contact-status').text('Protocolo: ' + protocolo)
/** REMOVE AS MSG NA E CONSTRIO A TELA NOVAMENTE (EVITAR DUPLICAR) */
$('.chat-window .sender').remove()
$('.chat-window .receiver').remove()
$('.chat-window .events').remove()
alertNotification(localStorage.getItem('session_uniqueid'),'remove')
alertNotification(localStorage.getItem('session_uniqueid'), 'remove')
dataContact.forEach(e => {
dataContact.forEach((e) => {
const datesend = e.msg_date ? converdata(new Date(e.msg_date).getTime()) : 'algumas horas';
<<<<<<< HEAD
let typesend = localStorage.getItem('my_uniqueid') == e.src ? 'sender': 'receiver'
=======
let typesend = localStorage.getItem('my_uniqueid') == e.dst ? 'receiver' : 'sender'
>>>>>>> 1e181ff (ajustes de funcionalidades)
let typesend = atendimentos.data[0].cliente_id == e.dst ? 'sender' : 'receiver'
if(e.type == 'text'){
if (e.type == 'text') {
$('.chat-window').append(`
<div class="${typesend}">
<span class="${typesend}-message">${e.content}</span>
@ -164,7 +154,14 @@ const selectNotification = (id) => {
)
}
if(e.type == 'finish' || e.type == 're_start'){
if (e.type == 'transfer') {
$('.chat-window').append(`
<div class="events">
<span class="events-message">${e.content} por ${e.profile_name}, ${datesend}.</span>
</div>`)
}
if (e.type == 'finish' || e.type == 're_start') {
$('.chat-window').append(`
<div class="events">
<span class="events-message">${e.content}</span>
@ -172,39 +169,37 @@ const selectNotification = (id) => {
)
}
if(e.type != 'text'){
if (e.type != 'text') {
const sendobj = {
filename: e.file_name,
id_provedor: e.id_provedor,
type: e.type,
mimetype: e.mimetype,
id_provedor: e.id_provedor,
type: e.type,
mimetype: e.mimetype,
from: typesend
}
messageTypeMedia(sendobj)
}
if(e.de == localStorage.getItem('my_uniqueid')){
if (e.de == localStorage.getItem('my_uniqueid')) {
const datereceived = e.datetime ? converdata(e.datetime) : 'algumas horas';
if(e.type == 'text'){
if (e.type == 'text') {
$('.chat-window').append(`
<div class="${typesend}">
<span class="${typesend}-message">${e.msg}</span>
<br/>
<span class="message-time">${datereceived}</span>
</div>`)
} else if (e.type == 'audio' || e.type == 'voice'){
const audio = `<audio controls>
<source src="data:audio/mpeg;base64,${e.msg}"></source>
</audio>`
} else if (e.type == 'audio' || e.type == 'voice') {
const audio = `<audio controls><source src="data:audio/mpeg;base64,${e.msg}"></source></audio>`
$('.chat-window').append(`
<div class="${typesend}">
<span class="${typesend}-message">${audio}</span>
<br/>
<span class="message-time">${datereceived}</span>
</div>`)
} else if (e.type == 'document'){
} else if (e.type == 'document') {
icontypes.forEach(l => {
if(e.filename.indexOf(l) >= 0){
if (e.filename.indexOf(l) >= 0) {
$('.chat-window').append(`
<div class="${typesend}">
<span class="${typesend}-message message-column">
@ -216,9 +211,9 @@ const selectNotification = (id) => {
<br/>
<span class="message-time">${datereceived}</span>
</div>`)
}
}
})
} else if (e.type == 'image'){
} else if (e.type == 'image') {
const fileimg = `data:${e.mimetype};base64,` + e.msg
$('.chat-window').append(`
<div class="${typesend}">
@ -252,7 +247,7 @@ const sendMessage = (obj = {}) => {
let mimetype = obj.mimetype ? obj.mimetype : 'text'
let filename = obj.filename ? obj.filename : Date.now()
if(!sendContent){
if (!sendContent) {
return
}
@ -277,12 +272,12 @@ const sendMessage = (obj = {}) => {
}
}
if(type != 'audio'){
if (type != 'audio') {
dataSend.event.mensagem.file_name = filename
}
enviarMensagem(dataSend)
let msgContent = type == 'text' ? sendContent : obj.fileContent
$('.chat-window').append(`
<div class="sender">
@ -305,9 +300,9 @@ const viewMessage = (ev) => {
const sessionOpen = localStorage.getItem('session_uniqueid')
const datesend = ev.event?.mensagem.datetime ? converdata(ev.event?.mensagem.datetime, true) : 'algumas horas';
if(ev.event?.mensagem.uniqueid == sessionOpen){
if (ev.event?.mensagem.uniqueid == sessionOpen) {
marcarMensagemVista(sessionOpen)
switch(ev.event?.mensagem.type){
switch (ev.event?.mensagem.type) {
case 'text':
$('.chat-window').append(`
<div class="receiver">
@ -326,12 +321,12 @@ const viewMessage = (ev) => {
}
const mediaDownload = ["image", "voice", "document", "audio", "video", "sticker"]
if(mediaDownload.indexOf(ev.event?.mensagem.type) >= 0){
if (mediaDownload.indexOf(ev.event?.mensagem.type) >= 0) {
const sendobj = {
filename: ev.event?.mensagem.file_name,
id_provedor: ev.event?.mensagem.id_provedor,
type: ev.event?.mensagem.type,
mimetype: ev.event?.mensagem.mimetype,
id_provedor: ev.event?.mensagem.id_provedor,
type: ev.event?.mensagem.type,
mimetype: ev.event?.mensagem.mimetype,
from: 'receiver'
}
messageTypeMedia(sendobj)
@ -348,9 +343,9 @@ const viewMessage = (ev) => {
const receiveNotification = (data) => {
let validate = null
switch(data.event?.type){
switch (data.event?.type) {
case "mensagem":
if(data.event.mensagem.uniqueid != localStorage.getItem('session_uniqueid')){
if (data.event.mensagem.uniqueid != localStorage.getItem('session_uniqueid')) {
notifyMe(data.event.contact.name, {
body: data.event.mensagem.content,
icon: `images/${data.event.mensagem.media}.png`,
@ -358,27 +353,28 @@ const receiveNotification = (data) => {
})
soundNotification(`${path}/sound/notification.mp3`)
}
/** VALIDA O NUMERO, VERIFICA SE O TEM ALGMA MSG INICIAL, SE JA TEVE UM NUMERO NA VERIFICACAO */
listarAtendimentoAgente(localStorage.getItem('id_empresa'), localStorage.getItem('my_uniqueid'))
validate = JSON.parse(localStorage.getItem('obj_notification'))
const vald = validate.data.filter((e) => {
return data.event?.mensagem.uniqueid == e.uniqueid
return data.event?.mensagem.uniqueid == e.uniqueid
})
if(data.event?.contact.number != localStorage.getItem('session_window')){
if (data.event?.contact.number != localStorage.getItem('session_window')) {
alertNotification(data.event.mensagem.uniqueid)
}
}
if (data.event?.mensagem.uniqueid && data.event?.contact.number && vald.length == 0) {
notifications(
{
{
uniqueid: data.event?.mensagem.uniqueid,
cliente_id: data.event?.contact.number,
context: data.event?.mensagem.media,
profile_name: data.event?.contact.name,
cliente_id: data.event?.contact.number,
context: data.event?.mensagem.media,
profile_name: data.event?.contact.name,
data_reg: data.event?.mensagem.datetime,
media: data.event?.mensagem.media,
status: 1,
action: 'mensagem',
}
@ -387,7 +383,7 @@ const receiveNotification = (data) => {
break
case "actions":
let obj
switch(data.event.mensagem.type){
switch (data.event.mensagem.type) {
case 'start':
case 'transfer':
case 'att_status':
@ -395,7 +391,7 @@ const receiveNotification = (data) => {
break
case 'finish':
case 're_start':
obj = {
obj = {
uniqueid: data.event?.mensagem.uniqueid,
action: data.event.mensagem.type,
}
@ -413,11 +409,11 @@ const receiveNotification = (data) => {
*/
const keepMensage = (ev) => {
let msg = JSON.parse(localStorage.getItem('keep_msg'))
if(!msg){
if (!msg) {
msg = { data: [] }
}
if(ev.event?.contact && ev.event?.mensagem.content){
if (ev.event?.contact && ev.event?.mensagem.content) {
msg.data.push(ev)
localStorage.removeItem('keep_msg');
localStorage.setItem('keep_msg', JSON.stringify(msg))
@ -427,37 +423,37 @@ const keepMensage = (ev) => {
/**
* FUNCAO PARA CAPTURAR O ARQUIVO A SER ENVIADO
*/
const sendMedia = (media = null) => {
const sendMedia = (media = null) => {
let rec
let filename
if($("#footer-content-left audio").length){
if(media.state == 'recording'){
if ($("#footer-content-left audio").length) {
if (media.state == 'recording') {
media.stop();
}
let el = $("#footer-content-left audio")[0].src
fileContent = $("#footer-content-left audio")[0].outerHTML
sendMessage({ content: el.replace("data:", "").replace(/^.+,/, ""), type: 'audio', mimetype: 'audio/mpeg', fileContent })
return
} else if($("#uploadfile")[0].files[0]) {
} else if ($("#uploadfile")[0].files[0]) {
let el = $("#uploadfile")[0].files[0]
rec = new Blob([el], { type : el.type })
rec = new Blob([el], { type: el.type })
let filesent = $("#myImg")
filesent[0].id = Date.now()
imgContent = filesent.css({'max-width': '60px'})[0].outerHTML
imgContent = filesent.css({ 'max-width': '60px' })[0].outerHTML
fileContent = `<a href="${URL.createObjectURL(rec)}" target="_blank">${imgContent}</a>`
filename = el.name
} else {
rec = $("#uploadimage")[0].files[0]
let filesent = $("#myImg")
filesent[0].id = Date.now()
fileContent = filesent.css({'max-width': '350px'})[0].outerHTML
fileContent = filesent.css({ 'max-width': '350px' })[0].outerHTML
$("#myImg").empty()
}
const file = new FileReader();
file.onload = function() {
file.onload = function () {
const typefile = rec.type.split("/")[0].indexOf('image') >= 0 ? rec.type.split("/")[0] : 'document'
sendMessage({ content: file.result.replace("data:", "").replace(/^.+,/, ""), type: typefile, mimetype: rec.type, fileContent, filename })
}
file.readAsDataURL(rec);
file.readAsDataURL(rec);
}

77
public/js/requests.js

@ -16,12 +16,6 @@ const listaMensagem = (uniqueid) => new Promise((resolve) => {
$.ajax({
url: `${server_api}/messages/${uniqueid}`,
type: "GET",
<<<<<<< HEAD
data: {
uniqueid
},
=======
>>>>>>> 1e181ff (ajustes de funcionalidades)
success: function (res) {
localStorage.removeItem('obj_contact')
localStorage.setItem('obj_contact', JSON.stringify(res))
@ -37,13 +31,6 @@ const listarAgentesDisponivel = (id_empresa) => new Promise((resolve) => {
$.ajax({
url: `${server_api}/supervisor/agentes/status/${id_empresa}/livre`,
type: "GET",
<<<<<<< HEAD
data: {
id_empresa,
agente_livre: "true"
},
=======
>>>>>>> 1e181ff (ajustes de funcionalidades)
success: function (res) {
resolve(res)
},
@ -57,19 +44,13 @@ const listarAtendimentoAgente = (id_empresa, matricula) => new Promise((resolve)
$.ajax({
url: `${server_api}/atendimentos/${id_empresa}/${matricula}`,
type: "GET",
<<<<<<< HEAD
data: {
matricula
},
=======
>>>>>>> 1e181ff (ajustes de funcionalidades)
success: function (res) {
localStorage.removeItem('obj_notification')
localStorage.setItem('obj_notification', JSON.stringify(res))
resolve(res)
},
error: function (res) {
}
});
})
@ -78,12 +59,6 @@ const listarPausasAgente = (id_empresa) => new Promise((resolve) => {
$.ajax({
url: `${server_api}/pausas/${id_empresa}`,
type: "GET",
<<<<<<< HEAD
data: {
id_empresa
},
=======
>>>>>>> 1e181ff (ajustes de funcionalidades)
success: function (res) {
resolve(res)
},
@ -205,19 +180,12 @@ const statusAgente = (id_empresa, matricula) => new Promise((resolve) => {
$.ajax({
url: `${server_api}/supervisor/agentes/${id_empresa}/${matricula}`,
type: "GET",
<<<<<<< HEAD
data: {
matricula,
id_empresa: empresa
},
=======
>>>>>>> 1e181ff (ajustes de funcionalidades)
success: function(res) {
success: function (res) {
localStorage.removeItem('obj_status')
localStorage.setItem('obj_status', JSON.stringify(res))
resolve(res)
},
error: function(res) {
error: function (res) {
alertModal(
`<h2>RECONECTANDO, AGUARDE &nbsp</h2><img id="imgReconnect" width="25px" src="${path}/images/loading.gif">`,
'[ POR FAVOR AGUARDE ]'
@ -233,7 +201,7 @@ const transferirAtendimento = (origem, destino, uniqueid) => new Promise((resolv
data: JSON.stringify({
matricula_origem: origem,
matricula_destino: destino,
uniqueid
uniqueid
}),
success: function (res) {
if (res.status == 'success') {
@ -246,9 +214,8 @@ const transferirAtendimento = (origem, destino, uniqueid) => new Promise((resolv
},
error: function (res) {
alertModal(
`<h2>OPS... HOUVE UM PROBLEMA &nbsp</h2><img id="imgReconnect" width="25px" src="${path}/images/alert.png">
<p>Não foi possível carregar as infoemacoes do agente!</p>
<p>Error: ${res}</p>`,
`<h3>OPS... HOUVE UM PROBLEMA &nbsp</h3><img id="imgReconnect" width="25px" src="${path}/images/alerta.png">
<p>Não foi possível carregar as infomacçõs do agente!</p>`,
'OPS!!!'
)
}
@ -270,3 +237,35 @@ const marcarMensagemVista = (uniqueid) => {
}
});
}
const buscarAtendimento = async (uniqueid) => {
return $.ajax({
url: `${server_api}/atendimentos/buscar`,
type: "POST",
data: JSON.stringify({
uniqueid
}),
success: function (res) {
return res
},
error: function (res) {
alert('Nao foi possivel carregar as informacoes do atendimento.')
}
});
}
const buscarUsuario = (matricula) => new Promise((resolve) =>{
$.ajax({
url: `${server_api}/usuario/buscar`,
type: "POST",
data: JSON.stringify({
matricula
}),
success: function (res) {
resolve(res)
},
error: function (res) {
alert('Nao foi possivel carregar as informacoes do usuario.')
}
});
})

26
public/js/util.js

@ -358,12 +358,13 @@ function recorderVoice () {
* @returns
*/
const buildNotification = (data = {}) => {
if(data.length == 'undefined'){
if(data.length == 'undefined' || (data.media == undefined && data.media == undefined) ){
return
}
const datesend = converdata(data.datetime)
const status = data.status == 0 ? 'opacity-3' : ''
return `<div class="chat ${status}" id="${data.uniqueid}" onclick="selectNotification(this.id)">
<div class="chat-left">
<img src="${path}/images/${data.media}.png"/>
@ -460,8 +461,13 @@ const notifications = (obj = {}) => {
}
}
notification.data.sort((a, b) => b.status - a.status)
notification.data.forEach(e => {
let chat = notification.data.filter(function (a) {
return !this[JSON.stringify(a.uniqueid)] && (this[JSON.stringify(a.uniqueid)] = true);
}, Object.create(null))
chat.sort((a, b) => b.status - a.status)
chat.forEach(e => {
chatList += buildNotification({
uniqueid: e.uniqueid,
number: e.cliente_id,
@ -479,11 +485,11 @@ const notifications = (obj = {}) => {
const monitorPausaAgente = () => {
statusAgente(localStorage.getItem('id_empresa'), localStorage.getItem('my_uniqueid')).then((agente) => {
let statusagent = agente.data[0].status
let statusagent = agente.data[0]?.status
const status = [
{ status: "LIVRE", class: "status-connect", html: `id="entrePause" src="${path}/images/pause.svg" title="Atribuir uma pausa"`, descricao: statusagent },
{ status: "PAUSA", class: "status-desconnect", html: `id="exitPause" src="${path}/images/play.svg" title="Remover a pausa"`, descricao: `${statusagent} - ${agente.data[0].motivo_pausa}` },
{ status: "PAUSA", class: "status-desconnect", html: `id="exitPause" src="${path}/images/play.svg" title="Remover a pausa"`, descricao: `${statusagent} - ${agente.data[0]?.motivo_pausa}` },
{ status: "OCUPADO", class: "status-reconnect", html: `id="entrePause" src="${path}/images/pause.svg" title="Atribuir uma pausa"`, descricao: statusagent },
{ status: "INDISPONIVEL", class: "status-reconnect", html: `id="exitPause" src="${path}/images/play.svg" title="Remover a pausa"`, descricao: statusagent },
]
@ -515,7 +521,7 @@ const supervisorAgente = () => {
window.close()
}
})
}, 30000 );
}, 30000);
}
/** CONNECT TO WS */
@ -531,7 +537,7 @@ const connect = (wsserver) => {
ws.onerror = function(err) {
alertModal(
`<h2>CONECTANDO NO SISTEMA! POR FAVOR AGUARDE.</h2>`,
`<h3>CONECTANDO NO SISTEMA! POR FAVOR AGUARDE.</h3>`,
`<img id="imgReconnect" width="20px" src="${path}/images/loading.gif">`
)
$("#status_agent").addClass("status-desconnect").text('DESCONECTADO');
@ -541,6 +547,7 @@ const connect = (wsserver) => {
ws.onopen = function wsconnect() {
$("#status_agent").addClass("status-reconnect").text('RECONECTANDO ...');
entrar(localStorage.getItem('my_uniqueid'), localStorage.getItem('obj_queue')).then((login) => {
console.log(login)
if(login.status == 'success' || login.message.indexOf('autenticado') >= 0){
$('#modalselect').css({display: 'none'})
monitorPausaAgente()
@ -548,7 +555,7 @@ const connect = (wsserver) => {
notifications()
} else if(login.status == 'error'){
alertModal(
`<h2>OPSS!! ${login.message} &nbsp</h2>`,
`<h3>OPSS!! ${login.message} &nbsp</h3>`,
`<img width="20px" src="${path}/images/alerta.png">`
)
$("#status_agent").addClass("status-desconnect").text('OFF');
@ -559,9 +566,8 @@ const connect = (wsserver) => {
};
ws.addEventListener("open", () => {
const storage = ['my_uniqueid', 'keep_msg', 'obj_contact', 'session_uniqueid', 'session_window']
ws.addEventListener("message", e => {
/** att: atualizacao do websocket */
if(e.data != 'att'){
const data = JSON.parse(e?.data)

Loading…
Cancel
Save