Skip to content

Instantly share code, notes, and snippets.

@tqcenglish
Created April 23, 2018 05:37
Show Gist options
  • Save tqcenglish/2740ac11f35a9939c1fc7ed93cd8bbc9 to your computer and use it in GitHub Desktop.
Save tqcenglish/2740ac11f35a9939c1fc7ed93cd8bbc9 to your computer and use it in GitHub Desktop.
ajax 设置请求头
$.ajaxSetup({
beforeSend: (xhr) => {
xhr.setRequestHeader('Authorization', 'Basic YWRtaW46YWRtaW4=');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment