axj-ab_ 1.0.3 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +16 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -597,8 +597,9 @@ var ab_ = {
597
597
  // 支持formData file var form = new FormData();form.append("file", fileObj);
598
598
  xhrReq(loading, headers, url, posts, callback, init) {
599
599
  var xhr = new XMLHttpRequest()
600
+ var done = XMLHttpRequest.DONE || 4
600
601
  xhr.onreadystatechange = function () {
601
- if (xhr.readyState === XMLHttpRequest.DONE) {
602
+ if (xhr.readyState === done) {
602
603
  loading && loading()
603
604
  if (callback) {
604
605
  if (xhr.status === 200) {
@@ -1230,4 +1231,18 @@ try {
1230
1231
  console.error(e)
1231
1232
  }
1232
1233
 
1234
+ try {
1235
+ if (globalThis) {
1236
+ if (globalThis.ab_) {
1237
+ ab_ = globalThis.ab_
1238
+
1239
+ } else {
1240
+ globalThis.ab_ = ab_
1241
+ }
1242
+ }
1243
+
1244
+ } catch (e) {
1245
+ console.error(e)
1246
+ }
1247
+
1233
1248
  module.exports = ab_
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "axj-ab_",
3
3
  "type": "commonjs",
4
- "version": "1.0.3",
4
+ "version": "1.0.6",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {