明树Git Lab

Commit 09a8c03a authored by zfp1's avatar zfp1

2

parent fbec1223
......@@ -37,7 +37,7 @@ app.get('/wechat', (req, res) => {
// 处理微信消息
app.post('/wechat', async (req, res) => {
try {
// try {
// 1. 验证签名
if (!validateWechatSignature(req)) {
console.error('Invalid signature in POST');
......@@ -75,10 +75,10 @@ app.post('/wechat', async (req, res) => {
res.set('Content-Type', 'text/xml');
console.log("responseXml:::" ,responseXml);
return res.send(responseXml);
} catch (error) {
console.error('Error processing message:', error);
res.status(500).send('Server Error');
}
// } catch (error) {
// console.error('Error processing message:', error);
// res.status(500).send('Server Error');
// }
});
// 调用DeepSeek API
......@@ -121,7 +121,7 @@ function buildTextResponse(message, content) {
FromUserName: { _: message.toUser },
CreateTime: Math.floor(Date.now() / 1000),
MsgType: 'text',
Content: content
Content: String(content)
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment