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.
- package/dist/vendor.js +61 -59
- package/package.json +1 -1
package/dist/vendor.js
CHANGED
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
import { d as
|
|
2
|
-
import { d as
|
|
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
|
|
6
|
-
import
|
|
7
|
-
import { ElMessage as
|
|
8
|
-
const j = (e,
|
|
9
|
-
const a = e[
|
|
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: " +
|
|
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
|
-
}
|
|
21
|
-
|
|
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 =
|
|
27
|
-
const
|
|
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 ===
|
|
31
|
-
|
|
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
|
|
35
|
-
for (let
|
|
36
|
-
if (r[
|
|
37
|
-
r.splice(
|
|
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:
|
|
46
|
-
return
|
|
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:
|
|
59
|
-
let { code:
|
|
60
|
-
return n = n || a || `API ${window.$l("Unknown 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(
|
|
67
|
+
}), d(t)) : (s === 403 && window.location.replace("/"), d(t)), e;
|
|
66
68
|
},
|
|
67
69
|
(e) => {
|
|
68
|
-
var
|
|
69
|
-
let
|
|
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
|
-
(
|
|
89
|
-
return
|
|
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
|
|
112
|
+
const s = {};
|
|
111
113
|
Object.keys(e.data).forEach((a) => {
|
|
112
114
|
const n = e.data[a];
|
|
113
|
-
[null, "", void 0].includes(n) || (
|
|
114
|
-
}), e.data =
|
|
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:
|
|
120
|
-
ex:
|
|
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:
|
|
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:
|
|
135
|
+
userId: h.id
|
|
134
136
|
},
|
|
135
|
-
baseURL:
|
|
136
|
-
url:
|
|
137
|
+
baseURL: w,
|
|
138
|
+
url: t,
|
|
137
139
|
method: a,
|
|
138
140
|
data: o,
|
|
139
|
-
ex:
|
|
141
|
+
ex: s
|
|
140
142
|
});
|
|
141
|
-
},
|
|
142
|
-
let
|
|
143
|
-
const { login:
|
|
144
|
-
return
|
|
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: `${
|
|
150
|
+
url: `${p}/${window.$api.common.upload}`,
|
|
149
151
|
method: "post",
|
|
150
|
-
data:
|
|
152
|
+
data: t
|
|
151
153
|
});
|
|
152
|
-
},
|
|
153
|
-
install(e,
|
|
154
|
-
|
|
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,
|
|
157
|
-
e.use(
|
|
158
|
-
let
|
|
159
|
-
if (
|
|
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(
|
|
162
|
-
|
|
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
|
-
|
|
167
|
-
}, D = (e,
|
|
168
|
-
const
|
|
169
|
-
for (const [a, n] of
|
|
170
|
-
|
|
171
|
-
return
|
|
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 _,
|