url参数传递

_nodeb=wb-task-body-getmessage

Config\AppNodeJs{ownerId}\nodejs.provider.json

{
  "nodejs": {
    "wb-task-body-getmessage": {
      "args": [],
      "moduleName": "~/Config/AppNodeJs/{ownerId}/plugins/{mkey}/fn-body-getmessage",
      "functionName": null,
      "lowerCamel": true
    },
    "wb-task-body-sendmessage": {
      "args": [],
      "moduleName": "~/Config/AppNodeJs/{ownerId}/plugins/{mkey}/fn-body-sendmessage",
      "functionName": null,
      "lowerCamel": true
    }
  }
}

fn-body-sendmessage.js

module.exports = function (callback, result, params, rmt, args) {
    let body = JSON.parse(result);
    let argParams = JSON.parse(params);
    //body.targetUser = "htyk125555";
    //body.targetDeviceNo = "yk1";
    //body.word = "hello";
    // #region 数据二次处理
    var bodyN = {
        "app": "app1", "taskId": null, "libraryId": "1021",
        "executeNumber": 1, "taskName": `【${body.targetUser}】特定粉丝私信`, "orgId": body.orgId,
        "orgName": null, "libraryName": "获取私信",
        "taskOrder": 30, "versionNo": "vTk23_5.1", "taskType": 3,
        "isExecuteNow": { "value": 0 },
        "beginTime": { "value": argParams._currentDate.replace("T", " ") },
        "endTime": { "value": argParams._currentDayE.replace("T", " ") }
    }

    var paramJson = { "word": body.word,"interal": 20, "targetUsers": [body.targetUser], "tagetDevices": [body.targetDeviceNo], "targetDevice": { "ids": [body.targetDeviceNo] }, "targetUser": { "ids": [body.targetUser] } };

    bodyN.paramJson = JSON.stringify(paramJson);
    // #endregion 数据二次处理

    callback(null, bodyN);
};
文档更新时间: 2022-06-14 11:44   作者:admin