code: function fetch(params) {
      let fetchObj = null;
      if (/^http(s{0,1}):\/\//.test(params.url)) {
          const pageLoc = location.href.match(/^https{0,1}:\/\/(.+?)(?=\/|$)/);
          const ajaxLoc = params.url.match(/^https{0,1}:\/\/(.+?)(?=\/|$)/);
          if (pageLoc.length === 2 && ajaxLoc.length === 2 && ajaxLoc[1] === pageLoc[1]) {
              fetchObj = this.ajax(params);
          } else {
              fetchObj = this.jsonp(params);
          }
      } else {
          fetchObj = this.ajax(params);
      }
      return fetchObj;
  }
docs: /* globals XMLHttpRequest window location document /* eslint-disable 
  get the data from url
  auto use jsonp or ajax
  @params 传入的参数
  @params.method
  @params.data
  @params.url
  @params.fail
  @params.success