Skip to content

Commit

Permalink
自动解析ajax请求的url
Browse files Browse the repository at this point in the history
  • Loading branch information
eshengsky committed Sep 4, 2017
1 parent f79b2b2 commit 9d74bae
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
18 changes: 17 additions & 1 deletion dist/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,22 @@
return isChrome || isFirefox;
}

/**
* 解析 url
*
* @param {string} url
* @returns
* @memberof Lajax
*/

}, {
key: '_resolveUrl',
value: function _resolveUrl(url) {
var link = document.createElement('a');
link.href = url;
return link.protocol + '//' + link.host + link.pathname + link.search + link.hash;
}

/**
* 自动记录 ajax 请求
*
Expand All @@ -408,7 +424,7 @@
}

this._lajaxMethod = args[0];
this._lajaxUrl = args[1];
this._lajaxUrl = that._resolveUrl(args[1]);
that.xhrOpen.apply(this, args);
};

Expand Down
Loading

0 comments on commit 9d74bae

Please sign in to comment.