chenyc
2024-11-04 78c8b3b69eb4acce21ea0aa18655f71b7c1feb2e
更新回传结果接口
1个文件已添加
1个文件已修改
1个文件已删除
5 ■■■■■ 已修改文件
app.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
img/G190166668888.png 补丁 | 查看 | 原始文档 | blame | 历史
test.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app.js
@@ -212,7 +212,9 @@
    const action = req.body.action;
    const deviceID = req.body.deviceID;
    const mode=req.body
    mode.action='webResults'
    logHttps(mode)
    console.log('----------')
    try {
        const datas=mode.datas
        datas.forEach(async element => {
@@ -360,6 +362,7 @@
const logHttps=(mode)=>{
    try{
        let sqlStr=`INSERT INTO system_log (id, code, url, parameter) VALUES (0, '', '${mode.action}', '${JSON.stringify(mode)}')`
        console.log(sqlStr)
        pool.promise().query(sqlStr)
    }catch (err) {
        console.error('访问日志记录错误:', err);
img/G190166668888.png
Binary files differ
test.js
New file
@@ -0,0 +1,2 @@
{"action":"webResults","deviceID":"G241016090739070",
"datas":[{"address":"","age":"25","UID":"20241104141547932","occurTime":"1730700947933","name":"雷雨","timestamp":"1730700947933","birthday":"","sex":"1","BMI":{"height":"168.5","bmi_normal":"[18.5,24.9]","weight":"56.3","bmi":"19.8"}}]}