code: function getParams(req, all) {
    const val = { query: {}, body: {}, params: {}, all: {} };
    if (all) {
      // 获取全部参数
      for (const k in req.query) {
        val.query[k] = req.query[k];
        val.all[k] = req.query[k];
      }
      for (const k in req.body) {
        val.body[k] = req.body[k];
        val.all[k] = req.body[k];
      }
      for (const k in req.params) {
        val.params[k] = req.params[k];
        val.all[k] = req.params[k];
      }
    } else {
      if (req.method === 'GET') {
        val.query = req.query;
        val.all = req.query;
      } else {
        val.body = req.body;
        val.all = req.body;
      }
      // 所有method都应该获取req.params
      for (const k in req.params) {
        val.params[k] = req.params[k];
        val.all[k] = req.params[k];
      }
    }
    return val;
  }
docs: 获取参数
  @param {Object} req
  @param {Boolean} all
  @returns {{}}