diff --git a/src/config.js b/src/config.js index b442a7a..7039fd3 100644 --- a/src/config.js +++ b/src/config.js @@ -12,6 +12,7 @@ export const WAI_HOST = 'http://202.103.68.93:3031/api/v1'; export const EMAIL_ATTA_HOST = 'https://p9axztuwd7x8a7.mycht.cn/attatchment'; // 邮件附件 // prod: +// export const WAI_HOST = 'https://wai-server-qq4qmtq7wc9he4.mycht.cn/api/v1'; export const EMAIL_HOST = 'https://p9axztuwd7x8a7.mycht.cn/mail-server/service-mail'; export const API_HOST = 'https://p9axztuwd7x8a7.mycht.cn/whatsapp_server/v2'; export const WS_URL = 'wss://p9axztuwd7x8a7.mycht.cn/whatsapp_server'; // prod: diff --git a/wai-server/api/messages/message.controller.js b/wai-server/api/messages/message.controller.js index a1e0505..4a60c0a 100644 --- a/wai-server/api/messages/message.controller.js +++ b/wai-server/api/messages/message.controller.js @@ -7,14 +7,6 @@ function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } -exports.sendText111 = async ctx => { - const { type } = ctx.params; - const body = ctx.request.body; - ctx.assert(null, 400, `debug: content: {${type}} {${body.content}}`); - ctx.assert(null, 400, 'The message info is malformed!'); - return body; -}; - exports.sendText = async ctx => { const { from, to, content } = ctx.request.body; if (!from || !content) { @@ -29,7 +21,7 @@ exports.sendText = async ctx => { } // return wsToSend; try { - await wsToSend.sendTextMessage(to, content); + wsToSend.sendTextMessage(to, content); return 'Message sent successfully'; // { wsToSend, ret: 'Message sent successfully' }; } catch (error) { console.error('Error sending message:', error);