@epxing/utils 0.0.0-stage → 5.3.0-beta.1
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/API.md +602 -0
- package/README.md +22 -2
- package/dist/_vendor/.pnpm/jsencrypt@3.5.4/_vendor/jsencrypt/bin/jsencrypt.min.js +1691 -0
- package/dist/_virtual/_commonjsHelpers.js +6 -0
- package/dist/_virtual/jsencrypt.min.js +31 -0
- package/dist/_virtual/jsencrypt.min2.js +4 -0
- package/dist/_virtual/preload-helper.js +88 -0
- package/dist/assets/ai-BBFn3QRy.png +0 -0
- package/dist/assets/ai_import-BxQ7Ohn6.png +0 -0
- package/dist/assets/app-DBNIokDP.png +0 -0
- package/dist/assets/approval-DGcBv-re.png +0 -0
- package/dist/assets/create_market_system-BH__UVbt.png +0 -0
- package/dist/assets/create_system-irg--ePh.png +0 -0
- package/dist/assets/custom-C-ujlHz1.png +0 -0
- package/dist/assets/default-icon-2193FMjv.png +0 -0
- package/dist/assets/ex_link-4fYPd9nh.png +0 -0
- package/dist/assets/excel-BYqRm2Y8.png +0 -0
- package/dist/assets/folder-CFVsNbjj.png +0 -0
- package/dist/assets/form-DD9HV-jN.png +0 -0
- package/dist/assets/import-tfKWbWVS.png +0 -0
- package/dist/assets/meta-Qorpi70B.png +0 -0
- package/dist/assets/module-DQrs7VAS.png +0 -0
- package/dist/assets/null-B2An29h4.png +0 -0
- package/dist/assets/option-CG02tIgh.svg +1 -0
- package/dist/assets/photo-uscRzRXF.png +0 -0
- package/dist/assets/process-Dcndu9m2.png +0 -0
- package/dist/assets/rule-DcYhYse0.png +0 -0
- package/dist/assets/service-CLYLpPl3.png +0 -0
- package/dist/assets/single_file-B3TJtJli.png +0 -0
- package/dist/assets/snapshot-history-BsVY9cVj.png +0 -0
- package/dist/assets/snapshot-manual-DBRfFHYI.png +0 -0
- package/dist/assets/snapshot-realtime-DjHnJI6C.png +0 -0
- package/dist/assets/staff-Bn_-_00l.png +0 -0
- package/dist/assets/sync_append-Bm8mtvZs.png +0 -0
- package/dist/assets/sync_append_update-DzjxqJ_U.png +0 -0
- package/dist/assets/sync_loading-D7LoNPFP.png +0 -0
- package/dist/assets/sync_replace-Cbbzz327.png +0 -0
- package/dist/assets/sync_update-Birao6Cr.png +0 -0
- package/dist/assets/userRole-D1LAdM6N.png +0 -0
- package/dist/assets/user_bg-BFHtaZjz.png +0 -0
- package/dist/src/Config.js +25 -0
- package/dist/src/asset-images.js +125 -0
- package/dist/src/assets/images/add.png.js +4 -0
- package/dist/src/assets/images/ai-button.png.js +4 -0
- package/dist/src/assets/images/ai.png.js +4 -0
- package/dist/src/assets/images/ai_import.png.js +4 -0
- package/dist/src/assets/images/app.png.js +4 -0
- package/dist/src/assets/images/approval.png.js +4 -0
- package/dist/src/assets/images/book.png.js +4 -0
- package/dist/src/assets/images/canvas-editor/alignment.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/arrow-left.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/arrow-right.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/block.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/bold.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/catalog.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/center.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/checkbox.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/close.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/codeblock.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/color.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/control.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/date.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/exit-fullscreen.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/format.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/highlight.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/hyperlink.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/image.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/italic.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/justify.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/latex.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/left.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/line-dash-dot-dot.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/line-dash-dot.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/line-dash-large-gap.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/line-dash-small-gap.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/line-dot.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/line-double.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/line-single.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/line-wavy.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/list.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/option.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/page-break.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/page-mode.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/page-scale-add.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/page-scale-minus.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/painter.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/paper-direction.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/paper-margin.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/paper-size.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/print.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/radio.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/redo.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/request-fullscreen.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/right.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/row-margin.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/search.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/separator.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/signature-undo.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/signature.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/size-add.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/size-minus.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/strikeout.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/subscript.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/superscript.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/table.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/title.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/trash.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/underline.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/undo.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/watermark.svg.js +4 -0
- package/dist/src/assets/images/canvas-editor/word-tool.svg.js +4 -0
- package/dist/src/assets/images/clear.png.js +4 -0
- package/dist/src/assets/images/create_market_system.png.js +4 -0
- package/dist/src/assets/images/create_system.png.js +4 -0
- package/dist/src/assets/images/custom.png.js +4 -0
- package/dist/src/assets/images/default-icon.png.js +4 -0
- package/dist/src/assets/images/ex_link.png.js +4 -0
- package/dist/src/assets/images/excel.png.js +4 -0
- package/dist/src/assets/images/file.png.js +4 -0
- package/dist/src/assets/images/folder.png.js +4 -0
- package/dist/src/assets/images/hall/form.png.js +4 -0
- package/dist/src/assets/images/hall/meta.png.js +4 -0
- package/dist/src/assets/images/hall/process.png.js +4 -0
- package/dist/src/assets/images/hall/rule.png.js +4 -0
- package/dist/src/assets/images/hall/service.png.js +4 -0
- package/dist/src/assets/images/hall/userRole.png.js +4 -0
- package/dist/src/assets/images/hr.png.js +4 -0
- package/dist/src/assets/images/import.png.js +4 -0
- package/dist/src/assets/images/jian.png.js +4 -0
- package/dist/src/assets/images/module.png.js +4 -0
- package/dist/src/assets/images/null.png.js +4 -0
- package/dist/src/assets/images/photo.png.js +4 -0
- package/dist/src/assets/images/qq.png.js +4 -0
- package/dist/src/assets/images/robot.png.js +4 -0
- package/dist/src/assets/images/single_file.png.js +4 -0
- package/dist/src/assets/images/snapshot-history.png.js +4 -0
- package/dist/src/assets/images/snapshot-manual.png.js +4 -0
- package/dist/src/assets/images/snapshot-realtime.png.js +4 -0
- package/dist/src/assets/images/staff.png.js +4 -0
- package/dist/src/assets/images/switch_app.png.js +4 -0
- package/dist/src/assets/images/sync_append.png.js +4 -0
- package/dist/src/assets/images/sync_append_update.png.js +4 -0
- package/dist/src/assets/images/sync_loading.png.js +4 -0
- package/dist/src/assets/images/sync_replace.png.js +4 -0
- package/dist/src/assets/images/sync_update.png.js +4 -0
- package/dist/src/assets/images/user_bg.png.js +4 -0
- package/dist/src/assets/images/weixin.png.js +4 -0
- package/dist/src/chart-config-update.js +17 -0
- package/dist/src/chart-data-adapters.js +112 -0
- package/dist/src/chart-option-override.js +128 -0
- package/dist/src/chart-option-paths.js +64 -0
- package/dist/src/chart-registry.js +46 -0
- package/dist/src/chart-render-host.js +57 -0
- package/dist/src/chart-request-broker.js +176 -0
- package/dist/src/chartTheme.js +683 -0
- package/dist/src/collection.js +25 -0
- package/dist/src/date-helper.js +60 -0
- package/dist/src/dom-helper.js +22 -0
- package/dist/src/eval-with.js +14 -0
- package/dist/src/fieldFactory.js +5 -0
- package/dist/src/formula.js +365 -0
- package/dist/src/hljs-lite.js +29 -0
- package/dist/src/index.js +24 -0
- package/dist/src/lazy-jsencrypt.js +13 -0
- package/dist/src/legacy.js +25 -0
- package/dist/src/locale.js +88 -0
- package/dist/src/menu-open.js +43 -0
- package/dist/src/mermaid.js +79 -0
- package/dist/src/meta.js +4 -0
- package/dist/src/mobile-chart-appearance.js +148 -0
- package/dist/src/moment-compat.js +558 -0
- package/dist/src/nav-history.js +184 -0
- package/dist/src/page.js +116 -0
- package/dist/src/pdf.viewer.js +4 -0
- package/dist/src/placeholder.js +64 -0
- package/dist/src/public.js +49 -0
- package/dist/src/security.js +26 -0
- package/dist/src/storage.js +107 -0
- package/dist/src/token-storage.js +108 -0
- package/dist/src/util.js +4 -0
- package/package.json +109 -3
- package/src/Config.js +25 -0
- package/src/asset-images.js +16 -0
- package/src/chart-config-update.js +16 -0
- package/src/chart-data-adapters.js +106 -0
- package/src/chart-option-override.js +126 -0
- package/src/chart-option-paths.js +63 -0
- package/src/chart-registry.js +41 -0
- package/src/chart-render-host.js +56 -0
- package/src/chart-request-broker.js +171 -0
- package/src/chartTheme.js +711 -0
- package/src/collection.js +28 -0
- package/src/date-helper.js +72 -0
- package/src/dom-helper.js +26 -0
- package/src/eval-with.js +21 -0
- package/src/fieldFactory.js +3 -0
- package/src/formula.js +362 -0
- package/src/hljs-lite.js +41 -0
- package/src/index.js +2 -0
- package/src/lazy-jsencrypt.js +36 -0
- package/src/legacy.js +29 -0
- package/src/locale.js +104 -0
- package/src/menu-open.js +72 -0
- package/src/mermaid.js +115 -0
- package/src/meta.js +2 -0
- package/src/mobile-chart-appearance.js +147 -0
- package/src/moment-compat.d.ts +91 -0
- package/src/moment-compat.js +744 -0
- package/src/nav-history.js +274 -0
- package/src/page.js +129 -0
- package/src/pdf.viewer.js +2 -0
- package/src/placeholder.js +107 -0
- package/src/public.js +11 -0
- package/src/security.js +29 -0
- package/src/storage.js +135 -0
- package/src/token-storage.js +120 -0
- package/src/util.js +2 -0
- package/types/Config.d.ts +4 -0
- package/types/collection.d.ts +40 -0
- package/types/date-helper.d.ts +11 -0
- package/types/date-time.d.ts +2 -0
- package/types/date.d.ts +1 -0
- package/types/dom-helper.d.ts +3 -0
- package/types/dom.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/moment-compat.d.ts +91 -0
- package/types/page.d.ts +56 -0
- package/types/placeholder.d.ts +42 -0
- package/types/public.d.ts +10 -0
- package/types/storage.d.ts +31 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
const state = {
|
|
2
|
+
// 当前由本应用压入且未被消耗的哑历史条数
|
|
3
|
+
entryCount: 0,
|
|
4
|
+
// 待吞掉的、由 consume/leaveApp 自身 history.go 触发的 popstate 数
|
|
5
|
+
suppressCount: 0,
|
|
6
|
+
suppressDeadline: 0,
|
|
7
|
+
// 正在处理系统返回:此期间联动触发的关闭动作不再回退历史
|
|
8
|
+
handlingPop: false,
|
|
9
|
+
// 冷启动退出守卫是否生效(见 install/markAppJump)
|
|
10
|
+
guardMode: false
|
|
11
|
+
};
|
|
12
|
+
const routerViews = [];
|
|
13
|
+
let pendingGo = 0;
|
|
14
|
+
let flushScheduled = false;
|
|
15
|
+
let bootIdentity = "";
|
|
16
|
+
const PREV_CONTEXT_KEY = "epx-nav-prev";
|
|
17
|
+
function pushGuard() {
|
|
18
|
+
window.history.pushState({ epxGuard: true }, "");
|
|
19
|
+
}
|
|
20
|
+
function markAppJump() {
|
|
21
|
+
try {
|
|
22
|
+
sessionStorage.setItem(PREV_CONTEXT_KEY, window.location.href);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function routeIdentity() {
|
|
27
|
+
const hash = window.location.hash || "";
|
|
28
|
+
let path = hash.charAt(0) === "#" ? hash.slice(1) : window.location.pathname;
|
|
29
|
+
path = path.split("?")[0];
|
|
30
|
+
return path.split("/").filter(Boolean).slice(0, 4).join("/");
|
|
31
|
+
}
|
|
32
|
+
function reloadIfLeftContext() {
|
|
33
|
+
if (bootIdentity && routeIdentity() !== bootIdentity) {
|
|
34
|
+
window.location.reload();
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
function handleLanding() {
|
|
40
|
+
if (reloadIfLeftContext()) return;
|
|
41
|
+
if (state.guardMode && state.entryCount <= 0 && pendingGo <= 0) {
|
|
42
|
+
pushGuard();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function registerRouterView(rv) {
|
|
46
|
+
if (routerViews.indexOf(rv) === -1) routerViews.push(rv);
|
|
47
|
+
}
|
|
48
|
+
function unregisterRouterView(rv) {
|
|
49
|
+
const index = routerViews.indexOf(rv);
|
|
50
|
+
if (index > -1) routerViews.splice(index, 1);
|
|
51
|
+
}
|
|
52
|
+
function pushEntry() {
|
|
53
|
+
bootIdentity = routeIdentity();
|
|
54
|
+
if (pendingGo > 0) {
|
|
55
|
+
pendingGo--;
|
|
56
|
+
state.entryCount++;
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
state.entryCount++;
|
|
60
|
+
window.history.pushState({ epxNav: state.entryCount }, "");
|
|
61
|
+
}
|
|
62
|
+
function consume(delta = 1) {
|
|
63
|
+
if (state.handlingPop) return;
|
|
64
|
+
const n = Math.min(delta, state.entryCount);
|
|
65
|
+
if (n <= 0) return;
|
|
66
|
+
state.entryCount -= n;
|
|
67
|
+
pendingGo += n;
|
|
68
|
+
scheduleFlush();
|
|
69
|
+
}
|
|
70
|
+
function consumeForPopup(popupObj) {
|
|
71
|
+
if (!popupObj || !popupObj._pushedHistory) return;
|
|
72
|
+
popupObj._pushedHistory = false;
|
|
73
|
+
consume(1);
|
|
74
|
+
}
|
|
75
|
+
function suppressNextPop() {
|
|
76
|
+
state.suppressCount++;
|
|
77
|
+
state.suppressDeadline = Date.now() + 1500;
|
|
78
|
+
}
|
|
79
|
+
function isAtRootPage() {
|
|
80
|
+
const opened = window.openedPopup;
|
|
81
|
+
if (Array.isArray(opened) && opened.some((popup) => popup && !popup.closed)) return false;
|
|
82
|
+
for (const rv of routerViews) {
|
|
83
|
+
if (!rv.routes || rv.routes.length === 0) continue;
|
|
84
|
+
if (!rv.$el || !isVisible(rv.$el)) continue;
|
|
85
|
+
if (rv.routes.length > 1) return false;
|
|
86
|
+
}
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
function leaveApp() {
|
|
90
|
+
const n = state.entryCount + pendingGo + 1;
|
|
91
|
+
state.entryCount = 0;
|
|
92
|
+
pendingGo = 0;
|
|
93
|
+
suppressNextPop();
|
|
94
|
+
window.history.go(-n);
|
|
95
|
+
}
|
|
96
|
+
function scheduleFlush() {
|
|
97
|
+
if (flushScheduled) return;
|
|
98
|
+
flushScheduled = true;
|
|
99
|
+
Promise.resolve().then(() => {
|
|
100
|
+
flushScheduled = false;
|
|
101
|
+
if (pendingGo <= 0) return;
|
|
102
|
+
const n = pendingGo;
|
|
103
|
+
pendingGo = 0;
|
|
104
|
+
suppressNextPop();
|
|
105
|
+
window.history.go(-n);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function isVisible(el) {
|
|
109
|
+
return !!el && el.isConnected && el.offsetParent !== null;
|
|
110
|
+
}
|
|
111
|
+
function findTopPage() {
|
|
112
|
+
let top = null;
|
|
113
|
+
for (const rv of routerViews) {
|
|
114
|
+
if (!rv.routes || rv.routes.length === 0) continue;
|
|
115
|
+
if (!rv.$el || !isVisible(rv.$el)) continue;
|
|
116
|
+
if (!top) {
|
|
117
|
+
top = rv;
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
const pos = top.$el.compareDocumentPosition(rv.$el);
|
|
121
|
+
if (pos & Node.DOCUMENT_POSITION_FOLLOWING) top = rv;
|
|
122
|
+
}
|
|
123
|
+
if (!top) return null;
|
|
124
|
+
const pageWrap = top.$refs && top.$refs.page;
|
|
125
|
+
return pageWrap && pageWrap.$refs && pageWrap.$refs.component || null;
|
|
126
|
+
}
|
|
127
|
+
function onPopstate(event) {
|
|
128
|
+
if (state.suppressCount > 0) {
|
|
129
|
+
if (Date.now() <= state.suppressDeadline) {
|
|
130
|
+
state.suppressCount--;
|
|
131
|
+
handleLanding();
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
state.suppressCount = 0;
|
|
135
|
+
}
|
|
136
|
+
Promise.resolve().then(() => {
|
|
137
|
+
if (event && event._epxNavHandled) return;
|
|
138
|
+
if (state.entryCount <= 0) {
|
|
139
|
+
handleLanding();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
state.entryCount--;
|
|
143
|
+
const page = findTopPage();
|
|
144
|
+
if (!page || typeof page.backPage !== "function") return;
|
|
145
|
+
state.handlingPop = true;
|
|
146
|
+
try {
|
|
147
|
+
page.backPage({ fromPopstate: true });
|
|
148
|
+
} finally {
|
|
149
|
+
state.handlingPop = false;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function install() {
|
|
154
|
+
if (window.__epxNavHistoryInstalled) return;
|
|
155
|
+
window.__epxNavHistoryInstalled = true;
|
|
156
|
+
window.__epxNavHistory = state;
|
|
157
|
+
bootIdentity = routeIdentity();
|
|
158
|
+
let cameFromApp = false;
|
|
159
|
+
try {
|
|
160
|
+
cameFromApp = !!sessionStorage.getItem(PREV_CONTEXT_KEY);
|
|
161
|
+
} catch (e) {
|
|
162
|
+
}
|
|
163
|
+
if (!cameFromApp && window.innerWidth <= 992) {
|
|
164
|
+
state.guardMode = true;
|
|
165
|
+
pushGuard();
|
|
166
|
+
}
|
|
167
|
+
const s = window.history.state;
|
|
168
|
+
if (s && typeof s.epxNav === "number" && s.epxNav > 0) {
|
|
169
|
+
state.entryCount = s.epxNav;
|
|
170
|
+
}
|
|
171
|
+
window.addEventListener("popstate", onPopstate);
|
|
172
|
+
}
|
|
173
|
+
export {
|
|
174
|
+
consume,
|
|
175
|
+
consumeForPopup,
|
|
176
|
+
install,
|
|
177
|
+
isAtRootPage,
|
|
178
|
+
leaveApp,
|
|
179
|
+
markAppJump,
|
|
180
|
+
pushEntry,
|
|
181
|
+
registerRouterView,
|
|
182
|
+
suppressNextPop,
|
|
183
|
+
unregisterRouterView
|
|
184
|
+
};
|
package/dist/src/page.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
class Page {
|
|
2
|
+
constructor(props) {
|
|
3
|
+
const { label, linkEntitys, relatedEntitys, sysId, data } = props;
|
|
4
|
+
const { CONTENT, FLAG, ID, META_ID, META_CODE, PAGE_ID, PAGE_CODE, PAGE_PATH, VISUAL_CONFIG_PATH, TITLE, HELP, SYSTEM, SYSTEM_CODE, RIGHT_CONTROL_MODE } = data;
|
|
5
|
+
this.label = label;
|
|
6
|
+
this.title = TITLE;
|
|
7
|
+
this.linkEntitys = linkEntitys;
|
|
8
|
+
this.relatedEntitys = relatedEntitys;
|
|
9
|
+
this.sysId = sysId;
|
|
10
|
+
this.config = eval("(" + (CONTENT || "{}") + ")");
|
|
11
|
+
this.flag = FLAG;
|
|
12
|
+
this.pageId = ID;
|
|
13
|
+
this.templateId = PAGE_ID;
|
|
14
|
+
this.metaId = META_ID;
|
|
15
|
+
this.metaCode = META_CODE;
|
|
16
|
+
this.pagePath = PAGE_PATH;
|
|
17
|
+
this.pageCode = PAGE_CODE;
|
|
18
|
+
this.system = SYSTEM;
|
|
19
|
+
this.systemCode = SYSTEM_CODE;
|
|
20
|
+
this.help = HELP;
|
|
21
|
+
this.rightControlMode = RIGHT_CONTROL_MODE;
|
|
22
|
+
this.visualConfigPath = VISUAL_CONFIG_PATH;
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
getPageId() {
|
|
26
|
+
return this.pageId;
|
|
27
|
+
}
|
|
28
|
+
getLabel() {
|
|
29
|
+
return this.label;
|
|
30
|
+
}
|
|
31
|
+
getMetaId() {
|
|
32
|
+
return this.metaId;
|
|
33
|
+
}
|
|
34
|
+
getFlag() {
|
|
35
|
+
return this.flag;
|
|
36
|
+
}
|
|
37
|
+
getPagePath() {
|
|
38
|
+
return this.pagePath;
|
|
39
|
+
}
|
|
40
|
+
getConfig() {
|
|
41
|
+
return this.config;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 主键字段
|
|
45
|
+
* @return {}
|
|
46
|
+
*/
|
|
47
|
+
getKey() {
|
|
48
|
+
return this.keyNames[0];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 获取所有属性
|
|
52
|
+
* @return {}
|
|
53
|
+
*/
|
|
54
|
+
getAttris() {
|
|
55
|
+
const data2 = [];
|
|
56
|
+
const m = this;
|
|
57
|
+
const attris = m.attributes;
|
|
58
|
+
attris.forEach((name, index) => {
|
|
59
|
+
const a = attris[name];
|
|
60
|
+
data2[index] = { ID: a.name, NAME: a.label };
|
|
61
|
+
});
|
|
62
|
+
return data2;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* ID对应LAVEL
|
|
66
|
+
*/
|
|
67
|
+
getIdLabelAttris() {
|
|
68
|
+
const data2 = [];
|
|
69
|
+
const m = this;
|
|
70
|
+
const attris = m.attributes;
|
|
71
|
+
attris.forEach((name, index) => {
|
|
72
|
+
const a = attris[name];
|
|
73
|
+
data2[index] = { ID: a.id, NAME: a.label };
|
|
74
|
+
});
|
|
75
|
+
return data2;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* NAME对应LAVEL
|
|
79
|
+
*/
|
|
80
|
+
getNameLabelAttris() {
|
|
81
|
+
const data2 = [];
|
|
82
|
+
const m = this;
|
|
83
|
+
const attris = m.attributes;
|
|
84
|
+
attris.forEach((name, index) => {
|
|
85
|
+
const a = attris[name];
|
|
86
|
+
data2[index] = { ID: a.name, NAME: a.label };
|
|
87
|
+
});
|
|
88
|
+
return data2;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* 根据字段ID获取字段Name
|
|
92
|
+
* @param {} attriId
|
|
93
|
+
* @return {}
|
|
94
|
+
*/
|
|
95
|
+
getAttriNameById(attriId) {
|
|
96
|
+
const me = this;
|
|
97
|
+
if (me.attriIds) {
|
|
98
|
+
return me.attriIds[attriId];
|
|
99
|
+
}
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* 根据字段key获取label
|
|
104
|
+
*/
|
|
105
|
+
getLabelByField(field) {
|
|
106
|
+
const m = this;
|
|
107
|
+
const attribute = m.getAttributes()[field];
|
|
108
|
+
if (attribute) {
|
|
109
|
+
return attribute.label;
|
|
110
|
+
}
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
export {
|
|
115
|
+
Page as default
|
|
116
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const PLACEHOLDER_RE = /#\{([\w\-.|$#]+)\}/g;
|
|
2
|
+
function lookup(path, source) {
|
|
3
|
+
if (source == null || typeof path !== "string" || !path) return { found: false, value: void 0 };
|
|
4
|
+
const keys = [];
|
|
5
|
+
let cur = "";
|
|
6
|
+
let inBracket = false;
|
|
7
|
+
for (const ch of path) {
|
|
8
|
+
if (ch === "[") {
|
|
9
|
+
inBracket = true;
|
|
10
|
+
if (cur) {
|
|
11
|
+
keys.push(cur);
|
|
12
|
+
cur = "";
|
|
13
|
+
}
|
|
14
|
+
} else if (ch === "]") {
|
|
15
|
+
inBracket = false;
|
|
16
|
+
if (cur) {
|
|
17
|
+
keys.push(cur.replace(/^['"](.*)['"]$/, "$1"));
|
|
18
|
+
cur = "";
|
|
19
|
+
}
|
|
20
|
+
} else if (ch === "." && !inBracket) {
|
|
21
|
+
if (cur) {
|
|
22
|
+
keys.push(cur);
|
|
23
|
+
cur = "";
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
cur += ch;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (cur) keys.push(cur);
|
|
30
|
+
if (!keys.length) return { found: false, value: void 0 };
|
|
31
|
+
let obj = source;
|
|
32
|
+
for (let i = 0; i < keys.length; i++) {
|
|
33
|
+
if (obj == null) return { found: false, value: void 0 };
|
|
34
|
+
const k = keys[i];
|
|
35
|
+
const has = typeof obj === "object" ? k in obj : Object.prototype.hasOwnProperty.call(Object(obj), k);
|
|
36
|
+
if (!has) return { found: false, value: void 0 };
|
|
37
|
+
obj = obj[k];
|
|
38
|
+
}
|
|
39
|
+
return { found: true, value: obj };
|
|
40
|
+
}
|
|
41
|
+
function resolveKey(path, sources = []) {
|
|
42
|
+
for (let i = 0; i < sources.length; i++) {
|
|
43
|
+
const r = lookup(path, sources[i]);
|
|
44
|
+
if (r.found) return { found: true, value: r.value, index: i };
|
|
45
|
+
}
|
|
46
|
+
return { found: false, value: void 0, index: -1 };
|
|
47
|
+
}
|
|
48
|
+
function resolvePlaceholders(text, sources = [], options = {}) {
|
|
49
|
+
if (typeof text !== "string" || text.indexOf("#{") === -1) return text;
|
|
50
|
+
const onMissing = options.onMissing || "empty";
|
|
51
|
+
return text.replace(PLACEHOLDER_RE, (match, path) => {
|
|
52
|
+
const r = resolveKey(path, sources);
|
|
53
|
+
if (!r.found) return onMissing === "keep" ? match : "";
|
|
54
|
+
return r.value == null ? "" : String(r.value);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const placeholder = { PLACEHOLDER_RE, lookup, resolveKey, resolvePlaceholders };
|
|
58
|
+
export {
|
|
59
|
+
PLACEHOLDER_RE,
|
|
60
|
+
placeholder as default,
|
|
61
|
+
lookup,
|
|
62
|
+
resolveKey,
|
|
63
|
+
resolvePlaceholders
|
|
64
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { default as default2 } from "./Config.js";
|
|
2
|
+
import { default as default3 } from "./page.js";
|
|
3
|
+
import { PLACEHOLDER_RE, lookup, default as default4, resolveKey, resolvePlaceholders } from "./placeholder.js";
|
|
4
|
+
import { getDayCountOfMonth, getDayCountOfYear, isDate, modifyDate, modifyTime, modifyWithTimeString, nextDate, nextMonth, nextYear, prevYear, range } from "./date-helper.js";
|
|
5
|
+
import { arrayFindIndex, coerceTruthyValueToArray, hasClass } from "./dom-helper.js";
|
|
6
|
+
import { default as default5, getXsrfToken, setXsrfToken, default as default6 } from "./storage.js";
|
|
7
|
+
import { createMoment, createMoment as createMoment2, createMoment as createMoment3 } from "./moment-compat.js";
|
|
8
|
+
import { assignWith, cloneDeep, debounce, get, isEmpty, isEqual, isNil, isObject, default as default7, set, throttle } from "./collection.js";
|
|
9
|
+
export {
|
|
10
|
+
default2 as Config,
|
|
11
|
+
PLACEHOLDER_RE,
|
|
12
|
+
default3 as Page,
|
|
13
|
+
arrayFindIndex,
|
|
14
|
+
assignWith,
|
|
15
|
+
cloneDeep,
|
|
16
|
+
coerceTruthyValueToArray,
|
|
17
|
+
default5 as cookie,
|
|
18
|
+
createMoment,
|
|
19
|
+
createMoment2 as dateTime,
|
|
20
|
+
debounce,
|
|
21
|
+
get,
|
|
22
|
+
getDayCountOfMonth,
|
|
23
|
+
getDayCountOfYear,
|
|
24
|
+
getXsrfToken,
|
|
25
|
+
hasClass,
|
|
26
|
+
isDate,
|
|
27
|
+
isEmpty,
|
|
28
|
+
isEqual,
|
|
29
|
+
isNil,
|
|
30
|
+
isObject,
|
|
31
|
+
default7 as lodash,
|
|
32
|
+
lookup,
|
|
33
|
+
modifyDate,
|
|
34
|
+
modifyTime,
|
|
35
|
+
modifyWithTimeString,
|
|
36
|
+
createMoment3 as moment,
|
|
37
|
+
nextDate,
|
|
38
|
+
nextMonth,
|
|
39
|
+
nextYear,
|
|
40
|
+
default4 as placeholder,
|
|
41
|
+
prevYear,
|
|
42
|
+
range,
|
|
43
|
+
resolveKey,
|
|
44
|
+
resolvePlaceholders,
|
|
45
|
+
set,
|
|
46
|
+
setXsrfToken,
|
|
47
|
+
default6 as storage,
|
|
48
|
+
throttle
|
|
49
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const DANGEROUS_PATTERNS = [
|
|
2
|
+
/\beval\s*\(/,
|
|
3
|
+
/(?:^|[^$])\balert\s*\(/,
|
|
4
|
+
/(?:^|[^$])\bconfirm\s*\(/,
|
|
5
|
+
/(?:^|[^$])\bprompt\s*\(/,
|
|
6
|
+
/\bdocument\s*\.\s*write\s*\(/,
|
|
7
|
+
/\bdocument\s*\.\s*writeln\s*\(/,
|
|
8
|
+
/\blocation\s*\.\s*(href|replace|assign)\s*[=(]/,
|
|
9
|
+
/\bsetTimeout\s*\(\s*['"`]/,
|
|
10
|
+
/\bsetInterval\s*\(\s*['"`]/,
|
|
11
|
+
/\bnew\s+Function\s*\(/,
|
|
12
|
+
/\bimportScripts\s*\(/,
|
|
13
|
+
/\bfetch\s*\(/,
|
|
14
|
+
/\bXMLHttpRequest\b/
|
|
15
|
+
];
|
|
16
|
+
function isSafeFn(fn) {
|
|
17
|
+
const hit = DANGEROUS_PATTERNS.find((pattern) => pattern.test(fn.toString()));
|
|
18
|
+
if (hit) {
|
|
19
|
+
console.warn("[security] 函数包含高危调用,已阻止执行。", hit);
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
isSafeFn
|
|
26
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
const EXPIRES_SUFFIX = ".expires";
|
|
2
|
+
const getArea = (session) => {
|
|
3
|
+
try {
|
|
4
|
+
return session ? window.sessionStorage : window.localStorage;
|
|
5
|
+
} catch (e) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
const getAreas = () => [getArea(true), getArea(false)].filter(Boolean);
|
|
10
|
+
const toExpiresAt = (expires) => {
|
|
11
|
+
if (expires === void 0 || expires === null || expires === "") return null;
|
|
12
|
+
if (expires instanceof Date) return expires.getTime();
|
|
13
|
+
const days = Number(expires);
|
|
14
|
+
if (Number.isNaN(days)) return null;
|
|
15
|
+
return Date.now() + days * 864e5;
|
|
16
|
+
};
|
|
17
|
+
const toText = (value) => {
|
|
18
|
+
if (typeof value === "string") return value;
|
|
19
|
+
if (value === void 0 || value === null) return "";
|
|
20
|
+
if (typeof value === "object") return JSON.stringify(value);
|
|
21
|
+
return String(value);
|
|
22
|
+
};
|
|
23
|
+
const readFrom = (area, key) => {
|
|
24
|
+
try {
|
|
25
|
+
const value = area.getItem(key);
|
|
26
|
+
if (value === null) return void 0;
|
|
27
|
+
const expiresAt = Number(area.getItem(key + EXPIRES_SUFFIX));
|
|
28
|
+
if (expiresAt && Date.now() > expiresAt) {
|
|
29
|
+
area.removeItem(key);
|
|
30
|
+
area.removeItem(key + EXPIRES_SUFFIX);
|
|
31
|
+
return void 0;
|
|
32
|
+
}
|
|
33
|
+
return value;
|
|
34
|
+
} catch (e) {
|
|
35
|
+
return void 0;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const removeFrom = (area, key) => {
|
|
39
|
+
try {
|
|
40
|
+
area.removeItem(key);
|
|
41
|
+
area.removeItem(key + EXPIRES_SUFFIX);
|
|
42
|
+
} catch (e) {
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const storage = {
|
|
46
|
+
/**
|
|
47
|
+
* @param {string} key
|
|
48
|
+
* @returns {string | undefined} 不存在或已过期返回 undefined(与 js-cookie 一致)
|
|
49
|
+
*/
|
|
50
|
+
get(key) {
|
|
51
|
+
if (key === void 0 || key === null) return void 0;
|
|
52
|
+
key = String(key);
|
|
53
|
+
const areas = getAreas();
|
|
54
|
+
for (let i = 0; i < areas.length; i++) {
|
|
55
|
+
const value = readFrom(areas[i], key);
|
|
56
|
+
if (value !== void 0) return value;
|
|
57
|
+
}
|
|
58
|
+
return void 0;
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* @param {string} key
|
|
62
|
+
* @param {*} value 非字符串会被转成字符串(对象走 JSON.stringify)
|
|
63
|
+
* @param {{ expires?: number | Date, session?: boolean }} [options]
|
|
64
|
+
* @returns {string | undefined} 实际写入的字符串
|
|
65
|
+
*/
|
|
66
|
+
set(key, value, options) {
|
|
67
|
+
if (key === void 0 || key === null) return void 0;
|
|
68
|
+
key = String(key);
|
|
69
|
+
const { session = false, expires } = options || {};
|
|
70
|
+
const target = getArea(session);
|
|
71
|
+
if (!target) return void 0;
|
|
72
|
+
const text = toText(value);
|
|
73
|
+
const expiresAt = toExpiresAt(expires);
|
|
74
|
+
try {
|
|
75
|
+
target.setItem(key, text);
|
|
76
|
+
if (expiresAt) target.setItem(key + EXPIRES_SUFFIX, String(expiresAt));
|
|
77
|
+
else target.removeItem(key + EXPIRES_SUFFIX);
|
|
78
|
+
} catch (e) {
|
|
79
|
+
return void 0;
|
|
80
|
+
}
|
|
81
|
+
const other = getArea(!session);
|
|
82
|
+
if (other) removeFrom(other, key);
|
|
83
|
+
return text;
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* @param {string} key
|
|
87
|
+
*/
|
|
88
|
+
remove(key) {
|
|
89
|
+
if (key === void 0 || key === null) return;
|
|
90
|
+
key = String(key);
|
|
91
|
+
getAreas().forEach((area) => removeFrom(area, key));
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const XSRF_TOKEN_KEY = "xsrf_token";
|
|
95
|
+
const getXsrfToken = () => storage.get(XSRF_TOKEN_KEY) || "";
|
|
96
|
+
const setXsrfToken = (token) => {
|
|
97
|
+
if (!token) return;
|
|
98
|
+
storage.set(XSRF_TOKEN_KEY, token, { session: true });
|
|
99
|
+
};
|
|
100
|
+
const clearXsrfToken = () => storage.remove(XSRF_TOKEN_KEY);
|
|
101
|
+
export {
|
|
102
|
+
XSRF_TOKEN_KEY,
|
|
103
|
+
clearXsrfToken,
|
|
104
|
+
storage as default,
|
|
105
|
+
getXsrfToken,
|
|
106
|
+
setXsrfToken
|
|
107
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import storage from "./storage.js";
|
|
2
|
+
const memoryTokens = /* @__PURE__ */ Object.create(null);
|
|
3
|
+
const memoryOnlyTokens = /* @__PURE__ */ Object.create(null);
|
|
4
|
+
let urlTokenConsumed = false;
|
|
5
|
+
const tokenTimes = (token) => {
|
|
6
|
+
try {
|
|
7
|
+
const encodedPayload = token.split(".")[1];
|
|
8
|
+
if (!encodedPayload) return null;
|
|
9
|
+
const base64 = encodedPayload.replace(/-/g, "+").replace(/_/g, "/");
|
|
10
|
+
const padding = "=".repeat((4 - base64.length % 4) % 4);
|
|
11
|
+
const claims = JSON.parse(window.atob(base64 + padding));
|
|
12
|
+
return {
|
|
13
|
+
issuedAt: Number(claims.iat) || 0,
|
|
14
|
+
expiresAt: Number(claims.exp) || 0
|
|
15
|
+
};
|
|
16
|
+
} catch (error) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const preferCandidateToken = (candidate, current) => {
|
|
21
|
+
if (!candidate || candidate === current) return false;
|
|
22
|
+
if (!current) return true;
|
|
23
|
+
const candidateTimes = tokenTimes(candidate);
|
|
24
|
+
const currentTimes = tokenTimes(current);
|
|
25
|
+
if (!candidateTimes || !currentTimes) return false;
|
|
26
|
+
const now = Math.floor(Date.now() / 1e3);
|
|
27
|
+
const candidateValid = !candidateTimes.expiresAt || candidateTimes.expiresAt > now;
|
|
28
|
+
const currentValid = !currentTimes.expiresAt || currentTimes.expiresAt > now;
|
|
29
|
+
if (candidateValid !== currentValid) return candidateValid;
|
|
30
|
+
if (candidateTimes.issuedAt !== currentTimes.issuedAt) {
|
|
31
|
+
return candidateTimes.issuedAt > currentTimes.issuedAt;
|
|
32
|
+
}
|
|
33
|
+
return candidateTimes.expiresAt > currentTimes.expiresAt;
|
|
34
|
+
};
|
|
35
|
+
const getUrlParam = (name, path) => {
|
|
36
|
+
const query = (path || "").split("?").slice(1).join("?");
|
|
37
|
+
if (!query) return "";
|
|
38
|
+
const item = query.split("&").find((part) => part.split("=")[0] === name);
|
|
39
|
+
if (!item) return "";
|
|
40
|
+
const value = item.split("=").slice(1).join("=");
|
|
41
|
+
try {
|
|
42
|
+
return decodeURIComponent(value);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const removeTokenParams = (path) => {
|
|
48
|
+
const parts = path.split("?");
|
|
49
|
+
if (parts.length < 2) return path;
|
|
50
|
+
const query = parts.slice(1).join("?").split("&").filter((item) => {
|
|
51
|
+
const name = item.split("=")[0];
|
|
52
|
+
return name !== "token" && name !== "_token";
|
|
53
|
+
});
|
|
54
|
+
return parts[0] + (query.length ? "?" + query.join("&") : "");
|
|
55
|
+
};
|
|
56
|
+
const clearUrlTokenParams = () => {
|
|
57
|
+
const search = removeTokenParams(window.location.search);
|
|
58
|
+
const hash = removeTokenParams(window.location.hash);
|
|
59
|
+
const url = window.location.pathname + search + hash;
|
|
60
|
+
try {
|
|
61
|
+
window.history.replaceState(window.history.state, document.title, url);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const getStoredToken = (storageKey) => {
|
|
66
|
+
const token = storage.get(storageKey) || "";
|
|
67
|
+
if (token) {
|
|
68
|
+
memoryTokens[storageKey] = token;
|
|
69
|
+
delete memoryOnlyTokens[storageKey];
|
|
70
|
+
return token;
|
|
71
|
+
}
|
|
72
|
+
if (memoryOnlyTokens[storageKey]) return memoryTokens[storageKey] || "";
|
|
73
|
+
delete memoryTokens[storageKey];
|
|
74
|
+
return "";
|
|
75
|
+
};
|
|
76
|
+
const setStoredToken = (storageKey, token) => {
|
|
77
|
+
if (!token) return;
|
|
78
|
+
memoryTokens[storageKey] = token;
|
|
79
|
+
let persisted = storage.set(storageKey, token);
|
|
80
|
+
if (persisted === void 0) {
|
|
81
|
+
persisted = storage.set(storageKey, token, { session: true });
|
|
82
|
+
}
|
|
83
|
+
if (persisted === void 0) memoryOnlyTokens[storageKey] = true;
|
|
84
|
+
else delete memoryOnlyTokens[storageKey];
|
|
85
|
+
};
|
|
86
|
+
const removeStoredToken = (storageKey) => {
|
|
87
|
+
delete memoryTokens[storageKey];
|
|
88
|
+
delete memoryOnlyTokens[storageKey];
|
|
89
|
+
storage.remove(storageKey);
|
|
90
|
+
};
|
|
91
|
+
const consumeUrlToken = (storageKey) => {
|
|
92
|
+
const storedToken = getStoredToken(storageKey);
|
|
93
|
+
if (urlTokenConsumed || !storageKey) return storedToken;
|
|
94
|
+
const urlToken = (getUrlParam("_token", window.location.hash) || getUrlParam("token", window.location.hash) || getUrlParam("_token", window.location.search) || getUrlParam("token", window.location.search)).replace(/^Bearer\s+/i, "").trim();
|
|
95
|
+
if (!urlToken) return storedToken;
|
|
96
|
+
urlTokenConsumed = true;
|
|
97
|
+
if (preferCandidateToken(urlToken, storedToken)) {
|
|
98
|
+
setStoredToken(storageKey, urlToken);
|
|
99
|
+
}
|
|
100
|
+
clearUrlTokenParams();
|
|
101
|
+
return getStoredToken(storageKey);
|
|
102
|
+
};
|
|
103
|
+
export {
|
|
104
|
+
consumeUrlToken,
|
|
105
|
+
getStoredToken,
|
|
106
|
+
removeStoredToken,
|
|
107
|
+
setStoredToken
|
|
108
|
+
};
|
package/dist/src/util.js
ADDED