docs: function validate(config, req) {
      var params = config.params || [],
          message = {},
          ret = {},
          messages = [],
          error = false;
  
      _.forEach(params, function(v) {
          var val = req.proxyParams.params[v.name] || req.proxyParams.body[v.name];
          val = val ? val + '' : val;
          var flag1,
              flag2,
              maxLength = Number(v.maxLength) + 1,
              minLength = Number(v.minLength) - 1;
          if (val) {
              if ((!v.maxLength || !v.minLength) || (val.length < maxLength && val.length > minLength)) {
                  flag1 = 1;
              } else {
                  flag1 = 2;
              }
  
              if (!v.reg || v.reg.test(val)) {
                  flag1 = 1;
              } else {
                  flag2 = 2;
              }
  
              if (flag1 === 2 || flag2 === 2) {
                  message[config.url + ':' + v.name] = v.message;
                  messages.push(message);
                  error = true;
              } else {
                  //如果是数字类型,转化为数字型
                  if(v.type.toUpperCase() === 'NUMBER') {
                      val = Number(val);
                  }
                  ret[v.name] = val;
              }
  
          } else {
              if (v.def) {
                  ret[v.name] = v.def;
              }
              if (v.require && !v.def) {
                  message[v.name] = v.name + '不能为空';
                  messages.push(message);
                  error = true;
              }
          }
      });
  
      return {
          msgs: messages,
          err: error,
          ret: ret
      };
  }