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