@bwg-ui/core 1.1.8 → 1.1.10
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/chunks/{BwgLargeUploader-DsaIHpYz.js → BwgLargeUploader-B5EtYKUz.js} +844 -810
- package/dist/chunks/{BwgLargeUploader-DsaIHpYz.js.map → BwgLargeUploader-B5EtYKUz.js.map} +1 -1
- package/dist/chunks/BwgLargeUploader-BPJcShgF.cjs +3 -0
- package/dist/chunks/{BwgLargeUploader-1yDku10l.cjs.map → BwgLargeUploader-BPJcShgF.cjs.map} +1 -1
- package/dist/chunks/{FileUtils-CmK-zHC5.cjs → FileUtils-BweAWoJt.cjs} +2 -2
- package/dist/chunks/{FileUtils-CmK-zHC5.cjs.map → FileUtils-BweAWoJt.cjs.map} +1 -1
- package/dist/chunks/{FileUtils-DsA-Sw37.js → FileUtils-CaU9Bzu2.js} +2 -2
- package/dist/chunks/{FileUtils-DsA-Sw37.js.map → FileUtils-CaU9Bzu2.js.map} +1 -1
- package/dist/chunks/{SSOHandler-B5rmYk8s.js → SSOHandler-C72Do3RD.js} +4 -4
- package/dist/chunks/{SSOHandler-B5rmYk8s.js.map → SSOHandler-C72Do3RD.js.map} +1 -1
- package/dist/chunks/{SSOHandler-DjL0sH7k.cjs → SSOHandler-ColywAGZ.cjs} +2 -2
- package/dist/chunks/{SSOHandler-DjL0sH7k.cjs.map → SSOHandler-ColywAGZ.cjs.map} +1 -1
- package/dist/chunks/{SearchBoxContext-CzDzVCVm.js → SearchBoxContext-CY4tAQcg.js} +2 -2
- package/dist/chunks/{SearchBoxContext-CzDzVCVm.js.map → SearchBoxContext-CY4tAQcg.js.map} +1 -1
- package/dist/chunks/{SearchBoxContext-mcPWk862.cjs → SearchBoxContext-DDBY44Wr.cjs} +2 -2
- package/dist/chunks/{SearchBoxContext-mcPWk862.cjs.map → SearchBoxContext-DDBY44Wr.cjs.map} +1 -1
- package/dist/chunks/{UtilsContext-DczQBfFi.cjs → UtilsContext-C4tlOndT.cjs} +2 -2
- package/dist/chunks/{UtilsContext-DczQBfFi.cjs.map → UtilsContext-C4tlOndT.cjs.map} +1 -1
- package/dist/chunks/{UtilsContext-BKUZmmKx.js → UtilsContext-JSHHfnWl.js} +4 -4
- package/dist/chunks/{UtilsContext-BKUZmmKx.js.map → UtilsContext-JSHHfnWl.js.map} +1 -1
- package/dist/chunks/{codeStore-rU4v3QIA.js → codeStore-IIp25egq.js} +2 -2
- package/dist/chunks/{codeStore-rU4v3QIA.js.map → codeStore-IIp25egq.js.map} +1 -1
- package/dist/chunks/{codeStore-BG8S_mdS.cjs → codeStore-KPL92rcv.cjs} +2 -2
- package/dist/chunks/{codeStore-BG8S_mdS.cjs.map → codeStore-KPL92rcv.cjs.map} +1 -1
- package/dist/chunks/envUtils-C9Gf5aek.js.map +1 -1
- package/dist/chunks/envUtils-CduTHoHu.cjs.map +1 -1
- package/dist/chunks/menuViewStore-DuS0VmkB.cjs +3 -0
- package/dist/chunks/menuViewStore-DuS0VmkB.cjs.map +1 -0
- package/dist/chunks/{menuViewStore-BwR3vgPM.js → menuViewStore-OKcSQq-s.js} +32 -28
- package/dist/chunks/menuViewStore-OKcSQq-s.js.map +1 -0
- package/dist/chunks/{popupStore-BGubYHZh.cjs → popupStore-BEoWGajT.cjs} +2 -2
- package/dist/chunks/{popupStore-BGubYHZh.cjs.map → popupStore-BEoWGajT.cjs.map} +1 -1
- package/dist/chunks/{popupStore-BJ_IYrdY.js → popupStore-D8RI04bU.js} +2 -2
- package/dist/chunks/{popupStore-BJ_IYrdY.js.map → popupStore-D8RI04bU.js.map} +1 -1
- package/dist/chunks/serviceConfig-9dHegQIK.cjs +3 -0
- package/dist/chunks/serviceConfig-9dHegQIK.cjs.map +1 -0
- package/dist/chunks/serviceConfig-Dhe7neaj.js +709 -0
- package/dist/chunks/serviceConfig-Dhe7neaj.js.map +1 -0
- package/dist/components/common/index.cjs +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/core/BwgUploader.d.ts +10 -0
- package/dist/components/core/BwgUploader.d.ts.map +1 -1
- package/dist/components/core/index.cjs +1 -1
- package/dist/components/core/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +9 -9
- package/dist/provider/contexts/UtilsContext.d.ts +6 -6
- package/dist/provider/index.cjs +1 -1
- package/dist/provider/index.js +2 -2
- package/dist/stores/index.cjs +1 -1
- package/dist/stores/index.d.ts +3 -1
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +5 -5
- package/dist/stores/menuViewStore.d.ts +3 -1
- package/dist/stores/menuViewStore.d.ts.map +1 -1
- package/dist/utils/apiUtils.d.ts +20 -6
- package/dist/utils/apiUtils.d.ts.map +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.js +2 -2
- package/dist/utils/notificationUtils.d.ts +3 -2
- package/dist/utils/notificationUtils.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/BwgLargeUploader-1yDku10l.cjs +0 -3
- package/dist/chunks/menuViewStore-BJak0NMm.cjs +0 -3
- package/dist/chunks/menuViewStore-BJak0NMm.cjs.map +0 -1
- package/dist/chunks/menuViewStore-BwR3vgPM.js.map +0 -1
- package/dist/chunks/serviceConfig-Cc8jfw_Y.cjs +0 -3
- package/dist/chunks/serviceConfig-Cc8jfw_Y.cjs.map +0 -1
- package/dist/chunks/serviceConfig-lAlRNVIw.js +0 -670
- package/dist/chunks/serviceConfig-lAlRNVIw.js.map +0 -1
|
@@ -0,0 +1,709 @@
|
|
|
1
|
+
import H from "axios";
|
|
2
|
+
import c from "crypto-js";
|
|
3
|
+
import { notification as N } from "antd";
|
|
4
|
+
import { create as Z } from "zustand";
|
|
5
|
+
import { i as O, g as V } from "./envUtils-C9Gf5aek.js";
|
|
6
|
+
const A = (e) => typeof e != "string" ? !e : e.trim().length === 0, X = (e, t) => A(e) ? t : e || "", Y = (e) => !A(e), Q = (e, t, r = "...") => e.length <= t ? e : e.substring(0, t) + r, B = (e) => A(e) ? e : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase(), ee = (e) => A(e) ? e : e.split(" ").map((t) => B(t)).join(" "), te = (e) => e.replace(/-([a-z])/g, (t) => t[1].toUpperCase()), re = (e) => e.replace(/[A-Z]/g, (t) => `_${t.toLowerCase()}`), se = (e) => e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`), ne = (e) => {
|
|
7
|
+
const r = e.replace(/\D/g, "").match(/^(\d{3})(\d{4})(\d{4})$/);
|
|
8
|
+
return r ? `${r[1]}-${r[2]}-${r[3]}` : e;
|
|
9
|
+
}, ae = (e) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e), oe = (e) => {
|
|
10
|
+
try {
|
|
11
|
+
return new URL(e), !0;
|
|
12
|
+
} catch {
|
|
13
|
+
return !1;
|
|
14
|
+
}
|
|
15
|
+
}, ce = (e) => e.replace(/\D/g, ""), ie = (e) => e.replace(/[^a-zA-Z0-9가-힣\s]/g, ""), ue = (e) => e.replace(/<[^>]*>/g, ""), le = (e) => e.replace(/\n/g, "<br>"), de = (e) => e.replace(/<br\s*\/?>/gi, `
|
|
16
|
+
`), ge = (e, t) => {
|
|
17
|
+
const r = e.match(t);
|
|
18
|
+
return r || [];
|
|
19
|
+
}, me = (e, t) => e.repeat(t), fe = (e, t, r = " ") => e.padStart(t, r), he = (e, t, r = " ") => e.padEnd(t, r), pe = (e, t, r = " ") => {
|
|
20
|
+
const s = t - e.length;
|
|
21
|
+
if (s <= 0) return e;
|
|
22
|
+
const n = Math.floor(s / 2), a = s - n;
|
|
23
|
+
return r.repeat(n) + e + r.repeat(a);
|
|
24
|
+
}, P = (e, t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") => {
|
|
25
|
+
let r = "";
|
|
26
|
+
for (let s = 0; s < e; s++)
|
|
27
|
+
r += t.charAt(Math.floor(Math.random() * t.length));
|
|
28
|
+
return r;
|
|
29
|
+
}, Se = (e) => e.split("").reverse().join(""), ye = (e, t) => (e.match(new RegExp(t, "g")) || []).length, Ce = (e) => e.trim().split(/\s+/).length, G = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
30
|
+
const t = Math.random() * 16 | 0;
|
|
31
|
+
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
32
|
+
}), $ = (e = 32) => {
|
|
33
|
+
const r = G().replace(/-/g, "");
|
|
34
|
+
return e >= 32 ? r + P(e - 32, "0123456789abcdef") : r.substring(0, e);
|
|
35
|
+
}, Ie = () => $(16), Ue = () => $(64), Ne = (e = 16) => P(e, "0123456789"), we = (e = 16) => P(e, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"), j = () => G(), K = () => j().replace(/-/g, ""), Ee = () => {
|
|
36
|
+
const e = Date.now().toString(36), t = P(8, "0123456789abcdef");
|
|
37
|
+
return e + t;
|
|
38
|
+
}, xe = (e, t = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") => e.replace(
|
|
39
|
+
/[X-Z]/g,
|
|
40
|
+
() => t.charAt(Math.floor(Math.random() * t.length))
|
|
41
|
+
), ve = (e) => {
|
|
42
|
+
const t = c.SHA256(e);
|
|
43
|
+
return c.enc.Base64.stringify(t);
|
|
44
|
+
}, k = () => "abcdefghij1234567890!@#$%^&*();;", F = () => "123456098765!@#$", De = (e) => {
|
|
45
|
+
if (!e) return "";
|
|
46
|
+
try {
|
|
47
|
+
const t = c.enc.Utf8.parse(k()), r = c.enc.Utf8.parse(F());
|
|
48
|
+
return c.AES.encrypt(e, t, {
|
|
49
|
+
iv: r,
|
|
50
|
+
padding: c.pad.Pkcs7,
|
|
51
|
+
mode: c.mode.CBC
|
|
52
|
+
}).toString();
|
|
53
|
+
} catch (t) {
|
|
54
|
+
return console.error("암호화 오류:", t), "";
|
|
55
|
+
}
|
|
56
|
+
}, be = (e) => {
|
|
57
|
+
if (!e) return "";
|
|
58
|
+
try {
|
|
59
|
+
const t = c.enc.Utf8.parse(k()), r = c.enc.Utf8.parse(F());
|
|
60
|
+
return c.AES.decrypt(e, t, {
|
|
61
|
+
iv: r,
|
|
62
|
+
padding: c.pad.Pkcs7,
|
|
63
|
+
mode: c.mode.CBC
|
|
64
|
+
}).toString(c.enc.Utf8);
|
|
65
|
+
} catch (t) {
|
|
66
|
+
return console.error("복호화 오류:", t), "";
|
|
67
|
+
}
|
|
68
|
+
}, Te = (e, t) => {
|
|
69
|
+
if (!e) return "";
|
|
70
|
+
try {
|
|
71
|
+
const r = t || k();
|
|
72
|
+
return c.AES.encrypt(e, r).toString();
|
|
73
|
+
} catch (r) {
|
|
74
|
+
return console.error("간단한 암호화 오류:", r), "";
|
|
75
|
+
}
|
|
76
|
+
}, Ae = (e, t) => {
|
|
77
|
+
if (!e) return "";
|
|
78
|
+
try {
|
|
79
|
+
const r = t || k();
|
|
80
|
+
return c.AES.decrypt(e, r).toString(c.enc.Utf8);
|
|
81
|
+
} catch (r) {
|
|
82
|
+
return console.error("간단한 복호화 오류:", r), "";
|
|
83
|
+
}
|
|
84
|
+
}, Pe = (e) => e ? c.MD5(e).toString() : "", Le = (e) => e ? c.SHA256(e).toString() : "", Oe = (e) => e ? c.enc.Base64.stringify(c.enc.Utf8.parse(e)) : "", ke = (e) => {
|
|
85
|
+
if (!e) return "";
|
|
86
|
+
try {
|
|
87
|
+
return c.enc.Base64.parse(e).toString(c.enc.Utf8);
|
|
88
|
+
} catch (t) {
|
|
89
|
+
return console.error("Base64 디코딩 오류:", t), "";
|
|
90
|
+
}
|
|
91
|
+
}, Ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
92
|
+
__proto__: null,
|
|
93
|
+
base64Decode: ke,
|
|
94
|
+
base64Encode: Oe,
|
|
95
|
+
br2nl: de,
|
|
96
|
+
bxmDecrypt: be,
|
|
97
|
+
bxmEncrypt: De,
|
|
98
|
+
capitalize: B,
|
|
99
|
+
capitalizeWords: ee,
|
|
100
|
+
center: pe,
|
|
101
|
+
countChar: ye,
|
|
102
|
+
countWords: Ce,
|
|
103
|
+
encryptSha256: ve,
|
|
104
|
+
extractNumbers: ce,
|
|
105
|
+
findPattern: ge,
|
|
106
|
+
formatPhoneNumber: ne,
|
|
107
|
+
generateAlphanumericUID: we,
|
|
108
|
+
generateCustomUID: xe,
|
|
109
|
+
generateGUID: j,
|
|
110
|
+
generateGUIDWithoutHyphens: K,
|
|
111
|
+
generateLongUID: Ue,
|
|
112
|
+
generateNumericUID: Ne,
|
|
113
|
+
generateRandomString: P,
|
|
114
|
+
generateShortUID: Ie,
|
|
115
|
+
generateTimestampUID: Ee,
|
|
116
|
+
generateUID: $,
|
|
117
|
+
isEmpty: A,
|
|
118
|
+
isNotEmpty: Y,
|
|
119
|
+
isSafeEmpty: X,
|
|
120
|
+
isValidEmail: ae,
|
|
121
|
+
isValidUrl: oe,
|
|
122
|
+
md5Hash: Pe,
|
|
123
|
+
nl2br: le,
|
|
124
|
+
padLeft: fe,
|
|
125
|
+
padRight: he,
|
|
126
|
+
removeHtmlTags: ue,
|
|
127
|
+
removeSpecialChars: ie,
|
|
128
|
+
repeat: me,
|
|
129
|
+
reverse: Se,
|
|
130
|
+
sha256Hash: Le,
|
|
131
|
+
simpleDecrypt: Ae,
|
|
132
|
+
simpleEncrypt: Te,
|
|
133
|
+
toCamelCase: te,
|
|
134
|
+
toKebabCase: se,
|
|
135
|
+
toSnakeCase: re,
|
|
136
|
+
truncate: Q
|
|
137
|
+
}, Symbol.toStringTag, { value: "Module" })), h = {
|
|
138
|
+
duration: 4.5,
|
|
139
|
+
// 4.5초
|
|
140
|
+
placement: "topRight"
|
|
141
|
+
};
|
|
142
|
+
class v {
|
|
143
|
+
constructor() {
|
|
144
|
+
}
|
|
145
|
+
static getInstance() {
|
|
146
|
+
return v.instance || (v.instance = new v()), v.instance;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* BwgError 전용 에러 알림
|
|
150
|
+
* @param props - 에러 메시지 설정
|
|
151
|
+
*/
|
|
152
|
+
showBwgError(t) {
|
|
153
|
+
const {
|
|
154
|
+
message: r,
|
|
155
|
+
description: s,
|
|
156
|
+
errorCode: n,
|
|
157
|
+
duration: a = h.duration,
|
|
158
|
+
placement: m = h.placement
|
|
159
|
+
} = t;
|
|
160
|
+
n?.startsWith("BXM") ? N.error({
|
|
161
|
+
message: `${r}`,
|
|
162
|
+
description: s || "오류가 발생했습니다. 다시 시도해주세요.",
|
|
163
|
+
duration: a,
|
|
164
|
+
placement: m,
|
|
165
|
+
style: {
|
|
166
|
+
borderLeft: "4px solid #ff4d4f",
|
|
167
|
+
backgroundColor: "#fff2f0"
|
|
168
|
+
}
|
|
169
|
+
}) : N.warning({
|
|
170
|
+
message: `${r}`,
|
|
171
|
+
description: s || "오류가 발생했습니다. 다시 시도해주세요.",
|
|
172
|
+
duration: a,
|
|
173
|
+
placement: m,
|
|
174
|
+
style: {
|
|
175
|
+
borderLeft: "4px solid #ff4d4f",
|
|
176
|
+
backgroundColor: "#fff2f0"
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* 성공 알림
|
|
182
|
+
*/
|
|
183
|
+
showSuccess(t, r, s) {
|
|
184
|
+
N.success({
|
|
185
|
+
message: `${t}`,
|
|
186
|
+
description: r,
|
|
187
|
+
duration: s || h.duration,
|
|
188
|
+
placement: h.placement
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* 정보 알림
|
|
193
|
+
*/
|
|
194
|
+
showInfo(t, r, s) {
|
|
195
|
+
N.info({
|
|
196
|
+
message: `${t}`,
|
|
197
|
+
description: r,
|
|
198
|
+
duration: s || h.duration,
|
|
199
|
+
placement: h.placement
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* 경고 알림
|
|
204
|
+
*/
|
|
205
|
+
showWarning(t, r, s) {
|
|
206
|
+
N.warning({
|
|
207
|
+
message: `${t}`,
|
|
208
|
+
description: r,
|
|
209
|
+
duration: s || h.duration,
|
|
210
|
+
placement: h.placement
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* 일반 에러 알림
|
|
215
|
+
*/
|
|
216
|
+
showError(t, r, s) {
|
|
217
|
+
N.error({
|
|
218
|
+
message: `${t}`,
|
|
219
|
+
description: r,
|
|
220
|
+
duration: s || h.duration,
|
|
221
|
+
placement: h.placement
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* 모든 알림 닫기
|
|
226
|
+
*/
|
|
227
|
+
destroy() {
|
|
228
|
+
N.destroy();
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* 특정 키의 알림 닫기
|
|
232
|
+
*/
|
|
233
|
+
close(t) {
|
|
234
|
+
N.destroy();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
const E = v.getInstance(), Me = (e) => {
|
|
238
|
+
E.showBwgError(e);
|
|
239
|
+
}, Qe = (e, t, r) => {
|
|
240
|
+
E.showSuccess(e, t, r);
|
|
241
|
+
}, et = (e, t, r) => {
|
|
242
|
+
E.showInfo(e, t, r);
|
|
243
|
+
}, tt = (e, t, r) => {
|
|
244
|
+
E.showWarning(e, t, r);
|
|
245
|
+
}, rt = (e, t, r) => {
|
|
246
|
+
E.showError(e, t, r);
|
|
247
|
+
}, st = () => {
|
|
248
|
+
E.destroy();
|
|
249
|
+
}, nt = (e) => {
|
|
250
|
+
E.close(e);
|
|
251
|
+
};
|
|
252
|
+
import.meta.env.DEV;
|
|
253
|
+
function _e(e, t) {
|
|
254
|
+
let r;
|
|
255
|
+
try {
|
|
256
|
+
r = e();
|
|
257
|
+
} catch {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
return {
|
|
261
|
+
getItem: (n) => {
|
|
262
|
+
var a;
|
|
263
|
+
const m = (f) => f === null ? null : JSON.parse(f, void 0), S = (a = r.getItem(n)) != null ? a : null;
|
|
264
|
+
return S instanceof Promise ? S.then(m) : m(S);
|
|
265
|
+
},
|
|
266
|
+
setItem: (n, a) => r.setItem(n, JSON.stringify(a, void 0)),
|
|
267
|
+
removeItem: (n) => r.removeItem(n)
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
const _ = (e) => (t) => {
|
|
271
|
+
try {
|
|
272
|
+
const r = e(t);
|
|
273
|
+
return r instanceof Promise ? r : {
|
|
274
|
+
then(s) {
|
|
275
|
+
return _(s)(r);
|
|
276
|
+
},
|
|
277
|
+
catch(s) {
|
|
278
|
+
return this;
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
} catch (r) {
|
|
282
|
+
return {
|
|
283
|
+
then(s) {
|
|
284
|
+
return this;
|
|
285
|
+
},
|
|
286
|
+
catch(s) {
|
|
287
|
+
return _(s)(r);
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
}, Re = (e, t) => (r, s, n) => {
|
|
292
|
+
let a = {
|
|
293
|
+
storage: _e(() => localStorage),
|
|
294
|
+
partialize: (o) => o,
|
|
295
|
+
version: 0,
|
|
296
|
+
merge: (o, U) => ({
|
|
297
|
+
...U,
|
|
298
|
+
...o
|
|
299
|
+
}),
|
|
300
|
+
...t
|
|
301
|
+
}, m = !1;
|
|
302
|
+
const S = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set();
|
|
303
|
+
let i = a.storage;
|
|
304
|
+
if (!i)
|
|
305
|
+
return e(
|
|
306
|
+
(...o) => {
|
|
307
|
+
console.warn(
|
|
308
|
+
`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`
|
|
309
|
+
), r(...o);
|
|
310
|
+
},
|
|
311
|
+
s,
|
|
312
|
+
n
|
|
313
|
+
);
|
|
314
|
+
const y = () => {
|
|
315
|
+
const o = a.partialize({ ...s() });
|
|
316
|
+
return i.setItem(a.name, {
|
|
317
|
+
state: o,
|
|
318
|
+
version: a.version
|
|
319
|
+
});
|
|
320
|
+
}, l = n.setState;
|
|
321
|
+
n.setState = (o, U) => (l(o, U), y());
|
|
322
|
+
const u = e(
|
|
323
|
+
(...o) => (r(...o), y()),
|
|
324
|
+
s,
|
|
325
|
+
n
|
|
326
|
+
);
|
|
327
|
+
n.getInitialState = () => u;
|
|
328
|
+
let d;
|
|
329
|
+
const I = () => {
|
|
330
|
+
var o, U;
|
|
331
|
+
if (!i) return;
|
|
332
|
+
m = !1, S.forEach((g) => {
|
|
333
|
+
var C;
|
|
334
|
+
return g((C = s()) != null ? C : u);
|
|
335
|
+
});
|
|
336
|
+
const x = ((U = a.onRehydrateStorage) == null ? void 0 : U.call(a, (o = s()) != null ? o : u)) || void 0;
|
|
337
|
+
return _(i.getItem.bind(i))(a.name).then((g) => {
|
|
338
|
+
if (g)
|
|
339
|
+
if (typeof g.version == "number" && g.version !== a.version) {
|
|
340
|
+
if (a.migrate) {
|
|
341
|
+
const C = a.migrate(
|
|
342
|
+
g.state,
|
|
343
|
+
g.version
|
|
344
|
+
);
|
|
345
|
+
return C instanceof Promise ? C.then((M) => [!0, M]) : [!0, C];
|
|
346
|
+
}
|
|
347
|
+
console.error(
|
|
348
|
+
"State loaded from storage couldn't be migrated since no migrate function was provided"
|
|
349
|
+
);
|
|
350
|
+
} else
|
|
351
|
+
return [!1, g.state];
|
|
352
|
+
return [!1, void 0];
|
|
353
|
+
}).then((g) => {
|
|
354
|
+
var C;
|
|
355
|
+
const [M, z] = g;
|
|
356
|
+
if (d = a.merge(
|
|
357
|
+
z,
|
|
358
|
+
(C = s()) != null ? C : u
|
|
359
|
+
), r(d, !0), M)
|
|
360
|
+
return y();
|
|
361
|
+
}).then(() => {
|
|
362
|
+
x?.(d, void 0), d = s(), m = !0, f.forEach((g) => g(d));
|
|
363
|
+
}).catch((g) => {
|
|
364
|
+
x?.(void 0, g);
|
|
365
|
+
});
|
|
366
|
+
};
|
|
367
|
+
return n.persist = {
|
|
368
|
+
setOptions: (o) => {
|
|
369
|
+
a = {
|
|
370
|
+
...a,
|
|
371
|
+
...o
|
|
372
|
+
}, o.storage && (i = o.storage);
|
|
373
|
+
},
|
|
374
|
+
clearStorage: () => {
|
|
375
|
+
i?.removeItem(a.name);
|
|
376
|
+
},
|
|
377
|
+
getOptions: () => a,
|
|
378
|
+
rehydrate: () => I(),
|
|
379
|
+
hasHydrated: () => m,
|
|
380
|
+
onHydrate: (o) => (S.add(o), () => {
|
|
381
|
+
S.delete(o);
|
|
382
|
+
}),
|
|
383
|
+
onFinishHydration: (o) => (f.add(o), () => {
|
|
384
|
+
f.delete(o);
|
|
385
|
+
})
|
|
386
|
+
}, a.skipHydration || I(), d || u;
|
|
387
|
+
}, $e = Re, p = Z()(
|
|
388
|
+
$e(
|
|
389
|
+
(e, t) => ({
|
|
390
|
+
user: null,
|
|
391
|
+
isLoggedIn: !1,
|
|
392
|
+
// 로그인
|
|
393
|
+
login: (r) => {
|
|
394
|
+
e({ user: r, isLoggedIn: !0 }), console.log("사용자 로그인:", r);
|
|
395
|
+
},
|
|
396
|
+
// 로그아웃
|
|
397
|
+
logout: () => {
|
|
398
|
+
e({ user: null, isLoggedIn: !1 }), console.log("사용자 로그아웃");
|
|
399
|
+
},
|
|
400
|
+
// 사용자 정보 업데이트
|
|
401
|
+
updateUser: (r) => {
|
|
402
|
+
const s = t().user;
|
|
403
|
+
s && e({ user: { ...s, ...r } });
|
|
404
|
+
}
|
|
405
|
+
}),
|
|
406
|
+
{
|
|
407
|
+
name: "user-storage",
|
|
408
|
+
// 로컬 스토리지 키
|
|
409
|
+
partialize: (e) => ({
|
|
410
|
+
user: e.user,
|
|
411
|
+
isLoggedIn: e.isLoggedIn
|
|
412
|
+
})
|
|
413
|
+
// 저장할 상태만 선택
|
|
414
|
+
}
|
|
415
|
+
)
|
|
416
|
+
), at = () => p.getState().user?.crprCd || null, We = () => p.getState().user?.userId || null, He = () => p.getState().user?.userNm || null, ot = () => p.getState().user?.userDvsn || null, ct = () => p.getState().user?.emplNo || null, Be = () => p.getState().user?.dprtCd || null, Ge = () => p.getState().user?.dprtNm || null, W = () => p.getState().user?.roleList || null, it = (e) => {
|
|
417
|
+
const t = W();
|
|
418
|
+
return t ? t.includes(e) : !1;
|
|
419
|
+
}, ut = (e) => {
|
|
420
|
+
const t = W();
|
|
421
|
+
return t ? e.some((r) => t.includes(r)) : !1;
|
|
422
|
+
}, lt = (e) => {
|
|
423
|
+
const t = W();
|
|
424
|
+
return t ? e.every((r) => t.includes(r)) : !1;
|
|
425
|
+
}, dt = () => p.getState().isLoggedIn, q = () => p.getState().user, gt = () => q() !== null, mt = () => {
|
|
426
|
+
const e = He(), t = We();
|
|
427
|
+
return e || t || null;
|
|
428
|
+
}, ft = () => {
|
|
429
|
+
const e = Ge(), t = Be();
|
|
430
|
+
return e || (t ? String(t) : null);
|
|
431
|
+
};
|
|
432
|
+
let T = null;
|
|
433
|
+
const ht = (e) => {
|
|
434
|
+
T === null && (T = e);
|
|
435
|
+
}, pt = () => T, St = async () => (console.log("IP 검증 비활성화됨 (성능 최적화)"), T || "unknown");
|
|
436
|
+
class w extends Error {
|
|
437
|
+
constructor(t, r, s, n) {
|
|
438
|
+
super(t), this.name = "ApiError", this.detailMsg = r, this.response = s, this.msgCd = n, Error.captureStackTrace && Error.captureStackTrace(this, w);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
const R = {
|
|
442
|
+
method: "POST",
|
|
443
|
+
timeout: 3e4,
|
|
444
|
+
// 30초
|
|
445
|
+
withCredentials: !0,
|
|
446
|
+
// 쿠키 포함
|
|
447
|
+
showLoading: !0,
|
|
448
|
+
showError: !0,
|
|
449
|
+
retryCount: 3,
|
|
450
|
+
retryDelay: 1e3
|
|
451
|
+
}, D = H.create({
|
|
452
|
+
timeout: R.timeout,
|
|
453
|
+
withCredentials: R.withCredentials,
|
|
454
|
+
headers: {
|
|
455
|
+
"Content-Type": "application/json; charset=utf-8",
|
|
456
|
+
Accept: "application/json; charset=utf-8"
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
O && (console.log("🔧 API Client Configuration:"), console.log(" - Timeout:", D.defaults.timeout), console.log(" - With Credentials:", D.defaults.withCredentials), console.log(" - Environment:", V()));
|
|
460
|
+
D.interceptors.request.use(
|
|
461
|
+
(e) => {
|
|
462
|
+
let t = "UNKNOWN", r = "UNKNOWN";
|
|
463
|
+
(/* @__PURE__ */ new Date()).getTime();
|
|
464
|
+
try {
|
|
465
|
+
e.data && e.data.header ? (t = e.data.header.trxCd || "UNKNOWN", r = e.data.header.guid || "UNKNOWN") : e.params && e.params.header && (t = e.params.header.trxCd || "UNKNOWN", r = e.params.header.guid || "UNKNOWN");
|
|
466
|
+
} catch (n) {
|
|
467
|
+
console.warn("trxCd/guid 추출 실패:", n);
|
|
468
|
+
}
|
|
469
|
+
e.trxCd = t, e.guid = r, e.requestStartTime = Date.now(), console.log(`🚀 API 요청 시작 [거래코드: ${t} / GUID: ${r}]`);
|
|
470
|
+
const s = localStorage.getItem("accessToken");
|
|
471
|
+
return s && (e.headers.Authorization = `Bearer ${s}`), e.headers["Content-Type"] = "application/json; charset=UTF-8", e.headers.Accept = "application/json; charset=UTF-8", e;
|
|
472
|
+
},
|
|
473
|
+
(e) => (console.error("❌ 요청 인터셉터 에러:", e), Promise.reject(e))
|
|
474
|
+
);
|
|
475
|
+
D.interceptors.response.use(
|
|
476
|
+
(e) => {
|
|
477
|
+
let t = "UNKNOWN", r = "UNKNOWN";
|
|
478
|
+
const s = (/* @__PURE__ */ new Date()).getTime();
|
|
479
|
+
try {
|
|
480
|
+
e.config.trxCd && (t = e.config.trxCd), e.config.guid ? r = e.config.guid : e.data && e.data.header && e.data.header.trxCd ? (t = e.data.header.trxCd, r = e.data.header.guid || "UNKNOWN") : e.config.data && e.config.data.header ? (t = e.config.data.header.trxCd || "UNKNOWN", r = e.config.data.header.guid || "UNKNOWN") : e.config.params && e.config.params.header && (t = e.config.params.header.trxCd || "UNKNOWN", r = e.config.params.header.guid || "UNKNOWN");
|
|
481
|
+
} catch (a) {
|
|
482
|
+
console.warn("trxCd/guid 추출 실패:", a);
|
|
483
|
+
}
|
|
484
|
+
let n = 0;
|
|
485
|
+
return e.config.requestStartTime && (n = s - e.config.requestStartTime), console.log(
|
|
486
|
+
`✅ API 응답 성공 [거래코드: ${t} / GUID : ${r}] - (소요시간: ${n}ms)`
|
|
487
|
+
), e;
|
|
488
|
+
},
|
|
489
|
+
async (e) => {
|
|
490
|
+
if (console.error("❌ API 응답 에러:", e), O && console.error("🚨 Error Details:", {
|
|
491
|
+
message: e.message,
|
|
492
|
+
status: e.response?.status,
|
|
493
|
+
statusText: e.response?.statusText,
|
|
494
|
+
data: e.response?.data,
|
|
495
|
+
config: {
|
|
496
|
+
url: e.config?.url,
|
|
497
|
+
method: e.config?.method,
|
|
498
|
+
baseURL: e.config?.baseURL
|
|
499
|
+
}
|
|
500
|
+
}), e.response?.status === 401) {
|
|
501
|
+
const t = localStorage.getItem("refreshToken");
|
|
502
|
+
if (t)
|
|
503
|
+
try {
|
|
504
|
+
const r = await H.post("/auth/refresh", {
|
|
505
|
+
refreshToken: t
|
|
506
|
+
});
|
|
507
|
+
if (r.data.accessToken) {
|
|
508
|
+
localStorage.setItem(
|
|
509
|
+
"accessToken",
|
|
510
|
+
r.data.accessToken
|
|
511
|
+
);
|
|
512
|
+
const s = e.config;
|
|
513
|
+
if (s)
|
|
514
|
+
return s.headers.Authorization = `Bearer ${r.data.accessToken}`, D(s);
|
|
515
|
+
}
|
|
516
|
+
} catch {
|
|
517
|
+
localStorage.removeItem("accessToken"), localStorage.removeItem("refreshToken"), window.location.href = "/login";
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
return Promise.reject(e);
|
|
521
|
+
}
|
|
522
|
+
);
|
|
523
|
+
const je = () => K(), L = async (e, t, r) => {
|
|
524
|
+
try {
|
|
525
|
+
const s = {
|
|
526
|
+
...R,
|
|
527
|
+
...r
|
|
528
|
+
}, n = {
|
|
529
|
+
method: s.method,
|
|
530
|
+
url: "/api/service",
|
|
531
|
+
timeout: s.timeout,
|
|
532
|
+
withCredentials: s.withCredentials
|
|
533
|
+
};
|
|
534
|
+
s.headers && (n.headers = s.headers);
|
|
535
|
+
const a = T || "unknown", m = __APP_CD__, S = __SYS_CD__;
|
|
536
|
+
console.log("@@ request param :: ", t);
|
|
537
|
+
const f = {
|
|
538
|
+
header: {
|
|
539
|
+
trxCd: e,
|
|
540
|
+
guid: je(),
|
|
541
|
+
userInfo: q(),
|
|
542
|
+
clientIp: a,
|
|
543
|
+
// 클라이언트 IP 추가 (서버에서 재확인 권장)
|
|
544
|
+
domainId: "DEFAULT",
|
|
545
|
+
appCd: m,
|
|
546
|
+
sysCd: S
|
|
547
|
+
},
|
|
548
|
+
// data: bxmEncrypt(JSON.stringify(data)),
|
|
549
|
+
data: t
|
|
550
|
+
};
|
|
551
|
+
O && (console.log("__BWG_LOCAL__ 테스트 입니다. ", O), console.log("📤 Request Data:", f)), s.method === "GET" ? n.params = f || s.params : (n.data = f || s.data, s.params && (n.params = s.params));
|
|
552
|
+
let i;
|
|
553
|
+
for (let y = 0; y <= (s.retryCount || 0); y++)
|
|
554
|
+
try {
|
|
555
|
+
const l = await D(n);
|
|
556
|
+
if (l.data.header?.resCd == 0) {
|
|
557
|
+
for (const u in l.data)
|
|
558
|
+
if (u !== "header")
|
|
559
|
+
return l.data[u];
|
|
560
|
+
return {};
|
|
561
|
+
} else {
|
|
562
|
+
const u = l.data.header, d = u?.msgs?.basicMsg || "요청 처리 중 오류가 발생했습니다.", I = u?.msgs?.detailMsgs || d, o = u?.msgCd;
|
|
563
|
+
throw new w(d, I, l, o);
|
|
564
|
+
}
|
|
565
|
+
} catch (l) {
|
|
566
|
+
if (l.isAxiosError && l.response) {
|
|
567
|
+
const u = l, d = u.response, I = d.data, o = I?.header?.msgs?.basicMsg || u.message || // 실패 시 Axios 에러 메시지 사용
|
|
568
|
+
"서버에서 오류가 발생했습니다.", U = I?.header?.msgs?.detailMsgs || // 상세 메시지로 응답 본문 제공 (문자열이 아니면 JSON으로 변환)
|
|
569
|
+
(typeof d.data == "string" ? d.data : JSON.stringify(d.data)) || o, x = I?.header?.msgCd;
|
|
570
|
+
i = new w(o, U, d, x);
|
|
571
|
+
} else
|
|
572
|
+
i = l;
|
|
573
|
+
if (l.isAxiosError && Ke(l) && y < (s.retryCount || 0)) {
|
|
574
|
+
await Fe(s.retryDelay || 1e3);
|
|
575
|
+
continue;
|
|
576
|
+
}
|
|
577
|
+
break;
|
|
578
|
+
}
|
|
579
|
+
if (i) {
|
|
580
|
+
if (s.showError) {
|
|
581
|
+
const y = i instanceof w ? i.message : "요청 처리 중 오류가 발생했습니다.", l = i instanceof w ? i.msgCd : "요청 처리 중 오류가 발생했습니다.", u = i instanceof w ? i.detailMsg : i.message;
|
|
582
|
+
Me({
|
|
583
|
+
message: y,
|
|
584
|
+
errorCode: l,
|
|
585
|
+
description: u,
|
|
586
|
+
duration: 5
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
throw i;
|
|
590
|
+
}
|
|
591
|
+
throw new Error("알 수 없는 API 오류가 발생했습니다.");
|
|
592
|
+
} catch (s) {
|
|
593
|
+
throw console.error("callService 최종 에러:", s), s;
|
|
594
|
+
}
|
|
595
|
+
}, Ke = (e) => !e.response || e.response.status >= 500 && e.response.status < 600, Fe = (e) => new Promise((t) => setTimeout(t, e)), yt = (e, t, r) => L(e, t, { ...r, method: "GET" }), Ct = (e, t, r) => L(e, t, { ...r, method: "POST" }), It = (e, t, r) => L(e, t, { ...r, method: "PUT" }), Ut = (e, t, r) => L(e, t, { ...r, method: "DELETE" }), Nt = (e, t, r) => L(e, t, { ...r, method: "PATCH" }), J = {
|
|
596
|
+
// 권한 관련
|
|
597
|
+
AUTH_BTNS: "SCMSIGN00202",
|
|
598
|
+
// 버튼 권한 조회
|
|
599
|
+
AUTH_MENU: "SCMSIGN00201",
|
|
600
|
+
// 메뉴 권한 조회
|
|
601
|
+
SRCH_CODE: "SCMSIGN00301",
|
|
602
|
+
// 코드 조회
|
|
603
|
+
// 팝업 관련
|
|
604
|
+
SRCH_POPU: "SCMPOPU00101",
|
|
605
|
+
// 팝업 조회
|
|
606
|
+
// 즐겨찾기 관련
|
|
607
|
+
AUTH_BMRK: "SCMBMRK00101"
|
|
608
|
+
// 즐겨찾기 관리
|
|
609
|
+
};
|
|
610
|
+
let b = {};
|
|
611
|
+
function wt(e) {
|
|
612
|
+
b = e, console.log("🔧 Provider 서비스코드 오버라이드 설정:", e);
|
|
613
|
+
}
|
|
614
|
+
function qe(e) {
|
|
615
|
+
if (b[e] && b[e].trim() !== "")
|
|
616
|
+
return console.log(`🔧 Provider 설정 사용: ${e} = ${b[e]}`), b[e];
|
|
617
|
+
const t = J[e];
|
|
618
|
+
return console.log(`🔧 기본값 사용: ${e} = ${t}`), t;
|
|
619
|
+
}
|
|
620
|
+
function Et() {
|
|
621
|
+
const e = {};
|
|
622
|
+
for (const t of Object.keys(J))
|
|
623
|
+
e[t] = qe(t);
|
|
624
|
+
return e;
|
|
625
|
+
}
|
|
626
|
+
export {
|
|
627
|
+
ft as $,
|
|
628
|
+
ae as A,
|
|
629
|
+
oe as B,
|
|
630
|
+
Pe as C,
|
|
631
|
+
le as D,
|
|
632
|
+
fe as E,
|
|
633
|
+
he as F,
|
|
634
|
+
ue as G,
|
|
635
|
+
ie as H,
|
|
636
|
+
Se as I,
|
|
637
|
+
Le as J,
|
|
638
|
+
Ae as K,
|
|
639
|
+
Te as L,
|
|
640
|
+
te as M,
|
|
641
|
+
se as N,
|
|
642
|
+
re as O,
|
|
643
|
+
Q as P,
|
|
644
|
+
Ut as Q,
|
|
645
|
+
yt as R,
|
|
646
|
+
Nt as S,
|
|
647
|
+
Ct as T,
|
|
648
|
+
It as U,
|
|
649
|
+
L as V,
|
|
650
|
+
pt as W,
|
|
651
|
+
je as X,
|
|
652
|
+
ht as Y,
|
|
653
|
+
St as Z,
|
|
654
|
+
at as _,
|
|
655
|
+
Oe as a,
|
|
656
|
+
mt as a0,
|
|
657
|
+
Be as a1,
|
|
658
|
+
Ge as a2,
|
|
659
|
+
ct as a3,
|
|
660
|
+
W as a4,
|
|
661
|
+
ot as a5,
|
|
662
|
+
We as a6,
|
|
663
|
+
q as a7,
|
|
664
|
+
He as a8,
|
|
665
|
+
lt as a9,
|
|
666
|
+
ut as aa,
|
|
667
|
+
it as ab,
|
|
668
|
+
gt as ac,
|
|
669
|
+
dt as ad,
|
|
670
|
+
nt as ae,
|
|
671
|
+
st as af,
|
|
672
|
+
E as ag,
|
|
673
|
+
rt as ah,
|
|
674
|
+
et as ai,
|
|
675
|
+
Qe as aj,
|
|
676
|
+
tt as ak,
|
|
677
|
+
Et as al,
|
|
678
|
+
qe as am,
|
|
679
|
+
wt as an,
|
|
680
|
+
p as ao,
|
|
681
|
+
$e as ap,
|
|
682
|
+
Ye as aq,
|
|
683
|
+
ke as b,
|
|
684
|
+
de as c,
|
|
685
|
+
be as d,
|
|
686
|
+
De as e,
|
|
687
|
+
B as f,
|
|
688
|
+
ee as g,
|
|
689
|
+
pe as h,
|
|
690
|
+
ye as i,
|
|
691
|
+
Ce as j,
|
|
692
|
+
ve as k,
|
|
693
|
+
ce as l,
|
|
694
|
+
ge as m,
|
|
695
|
+
ne as n,
|
|
696
|
+
we as o,
|
|
697
|
+
xe as p,
|
|
698
|
+
j as q,
|
|
699
|
+
K as r,
|
|
700
|
+
Ue as s,
|
|
701
|
+
Ne as t,
|
|
702
|
+
P as u,
|
|
703
|
+
Ie as v,
|
|
704
|
+
Ee as w,
|
|
705
|
+
$ as x,
|
|
706
|
+
A as y,
|
|
707
|
+
X as z
|
|
708
|
+
};
|
|
709
|
+
//# sourceMappingURL=serviceConfig-Dhe7neaj.js.map
|