Skip to content

Commit

Permalink
feat: delete console
Browse files Browse the repository at this point in the history
  • Loading branch information
AbigailDeng authored and AbigailDeng committed Aug 22, 2024
1 parent 13b0c05 commit 45403fb
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/util/httpProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,19 @@ let RequestLibraryXMLOnly = null;
let isFetch = false;
let NodeHeaders;
if (process.env.RUNTIME_ENV === 'browser') {
console.log(1);
// For browsers use DOM Api XMLHttpRequest
// serviceworker without window and document, only with self
// eslint-disable-next-line no-restricted-globals
const _self = typeof self === 'object' ? self : {};
const _window = typeof window === 'object' ? window : _self;
if (typeof _window.XMLHttpRequest !== 'undefined') {
console.log('1-1');
RequestLibrary = _window.XMLHttpRequest;
isFetch = false;
} else if (typeof _window.fetch !== 'undefined') {
console.log('1-2');
RequestLibrary = _window.fetch;
isFetch = true;
}
} else {
console.log(2);
// For node use xmlhttprequest
// eslint-disable-next-line global-require
RequestLibraryXMLOnly = require('xmlhttprequest').XMLHttpRequest;
Expand Down

0 comments on commit 45403fb

Please sign in to comment.