Merge branch 'main' of github.com:hainatravel/global-sales

dev/supplier-email-drawer
LiaoYijun 9 months ago
commit 81e63430c6

@ -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:

@ -89,10 +89,20 @@ function AuthApp() {
await readWebsocketLog()
if (window.$pageSpy) {
// window.$pageSpy.triggerPlugins('onOfflineLog', 'upload')
await window.$harbor.upload() // { clearCache: true, remark: '' }
messageApi.info('Success')
clearWebsocketLog()
sendNotify()
try {
// await window.$harbor.upload() // { clearCache: true, remark: '' }
// 1 , upload : 413 Payload Too Large
const now = Date.now()
await window.$harbor.uploadPeriods({
startTime: now - 60 * 60000,
endTime: now,
})
messageApi.info('Success')
clearWebsocketLog()
sendNotify()
} catch (error) {
messageApi.error('Failure')
}
} else {
messageApi.error('Failure')
}

@ -34,6 +34,8 @@ exports.newConnect = async ctx => {
};
exports.getAll = async () => {
const sessions = sessionService.sessions;
return Array.from(sessions);
const findConnection = await getConnection({});
return findConnection;
// const sessions = sessionService.sessions;
// return Array.from(sessions);
};

@ -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);

Loading…
Cancel
Save