magtool 1.6.5 → 1.6.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/dist/vendor.js +61 -59
  2. package/package.json +1 -1
package/dist/vendor.js CHANGED
@@ -1,40 +1,42 @@
1
- import { d as h } from "./util.js";
2
- import { d as k } from "./directive.js";
1
+ import { d as k } from "./util.js";
2
+ import { d as $ } from "./directive.js";
3
3
  import { p as f } from "./store.js";
4
4
  /* empty css */
5
- import { c as $ } from "./cpt/component.js";
6
- import m from "axios";
7
- import { ElMessage as p } from "element-plus";
8
- const j = (e, s, t) => {
9
- const a = e[s];
5
+ import { c as C } from "./cpt/component.js";
6
+ import c from "axios";
7
+ import { ElMessage as m } from "element-plus";
8
+ const j = (e, t, s) => {
9
+ const a = e[t];
10
10
  return a ? typeof a == "function" ? a() : Promise.resolve(a) : new Promise((n, o) => {
11
11
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
12
12
  o.bind(
13
13
  null,
14
14
  new Error(
15
- "Unknown variable dynamic import: " + s + (s.split("/").length !== t ? ". Note that variables only represent file names one level deep." : "")
15
+ "Unknown variable dynamic import: " + t + (t.split("/").length !== s ? ". Note that variables only represent file names one level deep." : "")
16
16
  )
17
17
  )
18
18
  );
19
19
  });
20
- }, c = void 0, C = void 0, l = m.create({
21
- baseURL: c,
20
+ };
21
+ let p, w;
22
+ const l = c.create({
23
+ baseURL: p,
22
24
  timeout: 0,
23
25
  withCredentials: !1
24
26
  });
25
27
  let r = [];
26
- const v = m.CancelToken, b = (e) => {
27
- const s = e.url + "_" + e.headers["Content-HI"] + "_" + e.ex, t = [];
28
+ const v = c.CancelToken, b = (e) => {
29
+ const t = e.url + "_" + e.headers["Content-HI"] + "_" + e.ex, s = [];
28
30
  if (r.length)
29
31
  for (let a in r)
30
- r[a].v === s && t.push(a);
31
- t.length > 0 && (r[t[0]].cb(), r.splice(t[0], 1));
32
+ r[a].v === t && s.push(a);
33
+ s.length > 0 && (r[s[0]].cb(), r.splice(s[0], 1));
32
34
  }, d = (e) => {
33
35
  if (e != null && e.url) {
34
- const s = e.url + "_" + e.headers["Content-HI"] + "_" + e.ex;
35
- for (let t in r)
36
- if (r[t].v === s) {
37
- r.splice(t, 1);
36
+ const t = e.url + "_" + e.headers["Content-HI"] + "_" + e.ex;
37
+ for (let s in r)
38
+ if (r[s].v === t) {
39
+ r.splice(s, 1);
38
40
  break;
39
41
  }
40
42
  }
@@ -42,8 +44,8 @@ const v = m.CancelToken, b = (e) => {
42
44
  l.interceptors.request.use(
43
45
  (e) => {
44
46
  e.headers = e.headers || {};
45
- const { login: s } = window.$store.launch(), { access_token: t, scope: a, token_type: n } = s.info;
46
- return t && e.headers["Content-HI"] && (e.headers[a] = `${n} ${t}`), b(e), e.cancelToken = new v((o) => {
47
+ const { login: t } = window.$store.launch(), { access_token: s, scope: a, token_type: n } = t.info;
48
+ return s && e.headers["Content-HI"] && (e.headers[a] = `${n} ${s}`), b(e), e.cancelToken = new v((o) => {
47
49
  r.push({
48
50
  v: e.url + "_" + e.headers["Content-HI"] + "_" + e.ex,
49
51
  cb: o
@@ -55,18 +57,18 @@ l.interceptors.request.use(
55
57
  }
56
58
  );
57
59
  l.interceptors.response.use(
58
- ({ data: e, config: s }) => {
59
- let { code: t, message: a, msg: n } = e;
60
- return n = n || a || `API ${window.$l("Unknown Error")}`, t === 200 ? d(s) : t === 500 ? (s.showMsg !== !1 && p.error({
60
+ ({ data: e, config: t }) => {
61
+ let { code: s, message: a, msg: n } = e;
62
+ return n = n || a || `API ${window.$l("Unknown Error")}`, s === 200 ? d(t) : s === 500 ? (t.showMsg !== !1 && m.error({
61
63
  grouping: !0,
62
64
  showClose: !0,
63
65
  duration: 0,
64
66
  message: n
65
- }), d(s)) : (t === 403 && window.location.replace("/"), d(s)), e;
67
+ }), d(t)) : (s === 403 && window.location.replace("/"), d(t)), e;
66
68
  },
67
69
  (e) => {
68
- var t, a, n, o, i;
69
- let s = !1;
70
+ var s, a, n, o, i;
71
+ let t = !1;
70
72
  if (e && e.response)
71
73
  switch (e.response.status) {
72
74
  case 403:
@@ -85,8 +87,8 @@ l.interceptors.response.use(
85
87
  e.message = `Connection Error-${e.response.status}`;
86
88
  }
87
89
  else
88
- (t = e.stack) != null && t.includes("timeout") ? e.message = window.$l("Timeout, Please Refresh") : (e.message = window.$l("Connect Failed"), s = !0);
89
- return s || ((a = e == null ? void 0 : e.response) == null ? void 0 : a.status) !== 403 && p.error({
90
+ (s = e.stack) != null && s.includes("timeout") ? e.message = window.$l("Timeout, Please Refresh") : (e.message = window.$l("Connect Failed"), t = !0);
91
+ return t || ((a = e == null ? void 0 : e.response) == null ? void 0 : a.status) !== 403 && m.error({
90
92
  grouping: !0,
91
93
  message: `${e.message} ${(o = (n = e.config) == null ? void 0 : n.headers) == null ? void 0 : o["Content-HI"]}`
92
94
  }), d(e.config), e.code === "ERR_CANCELED" ? Promise.resolve({ code: e.code, msg: e.message }) : Promise.resolve({
@@ -107,17 +109,17 @@ const y = function(e) {
107
109
  ...e.headers,
108
110
  "Content-HI": e.url
109
111
  }, e.data && window.$getType(e.data) === "Object") {
110
- const t = {};
112
+ const s = {};
111
113
  Object.keys(e.data).forEach((a) => {
112
114
  const n = e.data[a];
113
- [null, "", void 0].includes(n) || (t[a] = n);
114
- }), e.data = t;
115
+ [null, "", void 0].includes(n) || (s[a] = n);
116
+ }), e.data = s;
115
117
  }
116
118
  return e.url = "api/v2/ads", l(e);
117
119
  }, E = function({
118
120
  data: e,
119
- url: s,
120
- ex: t,
121
+ url: t,
122
+ ex: s,
121
123
  method: a = "post",
122
124
  emptyString: n = !1
123
125
  }) {
@@ -125,50 +127,50 @@ const y = function(e) {
125
127
  n === !1 && i.push("");
126
128
  for (let u in e)
127
129
  i.indexOf(e[u]) === -1 && (o[u] = e[u]);
128
- const { userinfo: w } = window.$store.launch();
130
+ const { userinfo: h } = window.$store.launch();
129
131
  return l({
130
132
  headers: {
131
133
  "Content-Type": "application/json",
132
134
  token: "8ab0c4e2ac6045a1bdc30221e06940a4",
133
- userId: w.id
135
+ userId: h.id
134
136
  },
135
- baseURL: C,
136
- url: s,
137
+ baseURL: w,
138
+ url: t,
137
139
  method: a,
138
140
  data: o,
139
- ex: t
141
+ ex: s
140
142
  });
141
- }, T = (e) => {
142
- let s = new FormData();
143
- const { login: t } = window.$store.launch(), { accToken: a } = t.info;
144
- return s.append("token", a), s.append("file", e.file), l({
143
+ }, R = (e) => {
144
+ let t = new FormData();
145
+ const { login: s } = window.$store.launch(), { accToken: a } = s.info;
146
+ return t.append("token", a), t.append("file", e.file), l({
145
147
  headers: {
146
148
  "Content-Type": "multipart/form-data"
147
149
  },
148
- url: `${c}/${window.$api.common.upload}`,
150
+ url: `${p}/${window.$api.common.upload}`,
149
151
  method: "post",
150
- data: s
152
+ data: t
151
153
  });
152
- }, I = {
153
- install(e, s) {
154
- console.info(s), window.$login = y, window.$get = _, window.$post = x, window.$xform = E, window.$upload = T;
154
+ }, T = {
155
+ install(e, t) {
156
+ p = t.baseURL, w = t.aiURL, window.$login = y, window.$get = _, window.$post = x, window.$xform = E, window.$upload = R;
155
157
  }
156
- }, O = (e, s) => {
157
- e.use(h).use(k).use(I, { baseUrl: "", aiURL: "" });
158
- let t;
159
- if (s.storeChips)
158
+ }, O = (e, t) => {
159
+ e.use(k).use($).use(T, t);
160
+ let s;
161
+ if (t.storeChips)
160
162
  try {
161
- const { store: a, pinia: n } = f(s.storeChips);
162
- t = a, e.provide("store", a).use(n);
163
+ const { store: a, pinia: n } = f(t.storeChips);
164
+ s = a, e.provide("store", a).use(n);
163
165
  } catch {
164
166
  throw new Error("RangeError: Maximum call stack size exceeded");
165
167
  }
166
- s.registCpt && $.regist(e);
167
- }, D = (e, s) => {
168
- const t = e.__vccOpts || e;
169
- for (const [a, n] of s)
170
- t[a] = n;
171
- return t;
168
+ t.registCpt && C.regist(e);
169
+ }, D = (e, t) => {
170
+ const s = e.__vccOpts || e;
171
+ for (const [a, n] of t)
172
+ s[a] = n;
173
+ return s;
172
174
  };
173
175
  export {
174
176
  D as _,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "magtool",
3
3
  "packageManager": "yarn@4.4.1",
4
- "version": "1.6.5",
4
+ "version": "1.6.6",
5
5
  "author": "matt avis",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",