lsc 3 ngày trước cách đây
mục cha
commit
9cabfef802
2 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 3 3
      mongo.js
  2. 1 1
      package.json

+ 3 - 3
mongo.js

@@ -87,9 +87,9 @@ async function updateUserData2(host, database, cename, data, res) {
         );
 
         console.log('数据更新成功');
-        //res.end(JSON.stringify({ status: "1" }))
+        res.end(JSON.stringify({ status: "1" }))
     } catch (err) {
-        //res.end(JSON.stringify({ status: "0", error: err.message })) // 返回错误信息
+        res.end(JSON.stringify({ status: "0", error: err.message })) // 返回错误信息
         console.error('更新失败', err);
     }
 }
@@ -174,7 +174,7 @@ router.route('/updateUserData').all((req, res, next) => {
     for (let key in data) {
         decryptedData[key] = decodeURIComponent(data[key]);
     }
-    updateUserData("mongodb://root:usestudio-1@172.16.9.240:27017?authSource=admin", "cocolog", "applog", {
+    updateUserData("mongodb://root:usestudio-1@123.58.32.151:11641?authSource=admin", "cocolog", "applog", {
         [date]: {
             [decryptedData.username]: // 使用变量username作为键
             {

+ 1 - 1
package.json

@@ -218,7 +218,7 @@
       "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz",
       "version": "2.1.17"
     },
-    "mongodb": "^6.15.0",
+    "mongodb": "^4.0.1",
     "morgan": "^1.9.1",
     "ms": {
       "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",