@pisell/core 0.0.2
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/README.md +1 -0
- package/es/app/app.d.ts +101 -0
- package/es/app/app.js +177 -0
- package/es/app/const.d.ts +4 -0
- package/es/app/const.js +6 -0
- package/es/app/index.d.ts +14 -0
- package/es/app/index.js +52 -0
- package/es/applicationManager/application.d.ts +197 -0
- package/es/applicationManager/application.js +469 -0
- package/es/applicationManager/index.d.ts +19 -0
- package/es/applicationManager/index.js +206 -0
- package/es/aws/index.d.ts +16 -0
- package/es/aws/index.js +76 -0
- package/es/cmd/const.d.ts +11 -0
- package/es/cmd/const.js +13 -0
- package/es/cmd/index.d.ts +13 -0
- package/es/cmd/index.js +91 -0
- package/es/cmd/type.d.ts +5 -0
- package/es/cmd/type.js +1 -0
- package/es/communicationManager/index.d.ts +59 -0
- package/es/communicationManager/index.js +174 -0
- package/es/config.d.ts +3 -0
- package/es/config.js +14 -0
- package/es/cookie/index.d.ts +13 -0
- package/es/cookie/index.js +47 -0
- package/es/css/global.less +73 -0
- package/es/css/index.less +31 -0
- package/es/css/variables.css +84 -0
- package/es/data/index.d.ts +8 -0
- package/es/data/index.js +16 -0
- package/es/history/config.d.ts +24 -0
- package/es/history/config.js +43 -0
- package/es/history/index.d.ts +26 -0
- package/es/history/index.js +80 -0
- package/es/history/type.d.ts +2 -0
- package/es/history/type.js +1 -0
- package/es/hooks/index.d.ts +12 -0
- package/es/hooks/index.js +13 -0
- package/es/hooks/useDelayedValue/index.d.ts +2 -0
- package/es/hooks/useDelayedValue/index.js +26 -0
- package/es/hooks/useDispatch/index.d.ts +2 -0
- package/es/hooks/useDispatch/index.js +2 -0
- package/es/hooks/useLowCode/index.d.ts +13 -0
- package/es/hooks/useLowCode/index.js +74 -0
- package/es/hooks/useStore/index.d.ts +6 -0
- package/es/hooks/useStore/index.js +11 -0
- package/es/index.d.ts +8 -0
- package/es/index.js +10 -0
- package/es/indexDB/index.d.ts +296 -0
- package/es/indexDB/index.js +1619 -0
- package/es/locales/en.d.ts +3 -0
- package/es/locales/en.js +5 -0
- package/es/locales/index.d.ts +39 -0
- package/es/locales/index.js +199 -0
- package/es/locales/original.d.ts +3 -0
- package/es/locales/original.js +7 -0
- package/es/locales/type.d.ts +19 -0
- package/es/locales/type.js +1 -0
- package/es/locales/zh-CN.d.ts +3 -0
- package/es/locales/zh-CN.js +5 -0
- package/es/locales/zh-HK.d.ts +3 -0
- package/es/locales/zh-HK.js +5 -0
- package/es/logger/feishu.d.ts +11 -0
- package/es/logger/feishu.js +50 -0
- package/es/logger/index.d.ts +135 -0
- package/es/logger/index.js +870 -0
- package/es/menuManager/hooks.d.ts +17 -0
- package/es/menuManager/hooks.js +136 -0
- package/es/menuManager/index.d.ts +28 -0
- package/es/menuManager/index.js +165 -0
- package/es/models/global.d.ts +32 -0
- package/es/models/global.js +66 -0
- package/es/models/index.d.ts +45 -0
- package/es/models/index.js +65 -0
- package/es/models/type.d.ts +2 -0
- package/es/models/type.js +1 -0
- package/es/plugin/index.d.ts +0 -0
- package/es/plugin/index.js +0 -0
- package/es/pubsub/example.d.ts +5 -0
- package/es/pubsub/example.js +92 -0
- package/es/pubsub/index.d.ts +73 -0
- package/es/pubsub/index.js +166 -0
- package/es/render/index.d.ts +0 -0
- package/es/render/index.js +0 -0
- package/es/request/cache.d.ts +46 -0
- package/es/request/cache.js +372 -0
- package/es/request/cancelToken.d.ts +38 -0
- package/es/request/cancelToken.js +59 -0
- package/es/request/config.d.ts +3 -0
- package/es/request/config.js +63 -0
- package/es/request/constants.d.ts +2 -0
- package/es/request/constants.js +6 -0
- package/es/request/index.d.ts +24 -0
- package/es/request/index.js +267 -0
- package/es/request/pisell2Request.d.ts +6 -0
- package/es/request/pisell2Request.js +62 -0
- package/es/request/type.d.ts +57 -0
- package/es/request/type.js +10 -0
- package/es/request/utils.d.ts +46 -0
- package/es/request/utils.js +147 -0
- package/es/routes/config.d.ts +7 -0
- package/es/routes/config.js +17 -0
- package/es/routes/index.d.ts +28 -0
- package/es/routes/index.js +151 -0
- package/es/socket/components/SocketMonitorPage.d.ts +6 -0
- package/es/socket/components/SocketMonitorPage.js +485 -0
- package/es/socket/components/index.d.ts +2 -0
- package/es/socket/components/index.js +2 -0
- package/es/socket/constants.d.ts +33 -0
- package/es/socket/constants.js +39 -0
- package/es/socket/events.d.ts +31 -0
- package/es/socket/events.js +19 -0
- package/es/socket/heartbeat.d.ts +66 -0
- package/es/socket/heartbeat.js +184 -0
- package/es/socket/index.d.ts +61 -0
- package/es/socket/index.js +246 -0
- package/es/socket/monitor.d.ts +169 -0
- package/es/socket/monitor.js +448 -0
- package/es/socket/reconnect.d.ts +61 -0
- package/es/socket/reconnect.js +199 -0
- package/es/socket/socket.d.ts +130 -0
- package/es/socket/socket.js +613 -0
- package/es/socket/types.d.ts +85 -0
- package/es/socket/types.js +35 -0
- package/es/storage/index.d.ts +17 -0
- package/es/storage/index.js +46 -0
- package/es/tasks/index.d.ts +127 -0
- package/es/tasks/index.js +1119 -0
- package/es/tasks/scheduledTasksExample.d.ts +61 -0
- package/es/tasks/scheduledTasksExample.js +351 -0
- package/es/tasks/type.d.ts +100 -0
- package/es/tasks/type.js +1 -0
- package/es/tasks/useTasks.d.ts +5 -0
- package/es/tasks/useTasks.js +25 -0
- package/es/type.d.ts +2 -0
- package/es/type.js +1 -0
- package/es/utils/adaptiveThrottle/index.d.ts +36 -0
- package/es/utils/adaptiveThrottle/index.js +136 -0
- package/es/variables/VariablesProvider.d.ts +7 -0
- package/es/variables/VariablesProvider.js +12 -0
- package/es/variables/config.d.ts +3 -0
- package/es/variables/config.js +16 -0
- package/es/variables/index.d.ts +6 -0
- package/es/variables/index.js +5 -0
- package/es/variables/type.d.ts +2 -0
- package/es/variables/type.js +1 -0
- package/es/website/index.d.ts +6 -0
- package/es/website/index.js +65 -0
- package/lib/app/app.d.ts +101 -0
- package/lib/app/app.js +171 -0
- package/lib/app/const.d.ts +4 -0
- package/lib/app/const.js +33 -0
- package/lib/app/index.d.ts +14 -0
- package/lib/app/index.js +76 -0
- package/lib/applicationManager/application.d.ts +197 -0
- package/lib/applicationManager/application.js +280 -0
- package/lib/applicationManager/index.d.ts +19 -0
- package/lib/applicationManager/index.js +88 -0
- package/lib/aws/index.d.ts +16 -0
- package/lib/aws/index.js +67 -0
- package/lib/cmd/const.d.ts +11 -0
- package/lib/cmd/const.js +39 -0
- package/lib/cmd/index.d.ts +13 -0
- package/lib/cmd/index.js +96 -0
- package/lib/cmd/type.d.ts +5 -0
- package/lib/cmd/type.js +17 -0
- package/lib/communicationManager/index.d.ts +59 -0
- package/lib/communicationManager/index.js +102 -0
- package/lib/config.d.ts +3 -0
- package/lib/config.js +36 -0
- package/lib/cookie/index.d.ts +13 -0
- package/lib/cookie/index.js +62 -0
- package/lib/css/global.less +73 -0
- package/lib/css/index.less +31 -0
- package/lib/css/variables.css +84 -0
- package/lib/data/index.d.ts +8 -0
- package/lib/data/index.js +38 -0
- package/lib/history/config.d.ts +24 -0
- package/lib/history/config.js +41 -0
- package/lib/history/index.d.ts +26 -0
- package/lib/history/index.js +99 -0
- package/lib/history/type.d.ts +2 -0
- package/lib/history/type.js +17 -0
- package/lib/hooks/index.d.ts +12 -0
- package/lib/hooks/index.js +44 -0
- package/lib/hooks/useDelayedValue/index.d.ts +2 -0
- package/lib/hooks/useDelayedValue/index.js +36 -0
- package/lib/hooks/useDispatch/index.d.ts +2 -0
- package/lib/hooks/useDispatch/index.js +26 -0
- package/lib/hooks/useLowCode/index.d.ts +13 -0
- package/lib/hooks/useLowCode/index.js +75 -0
- package/lib/hooks/useStore/index.d.ts +6 -0
- package/lib/hooks/useStore/index.js +33 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +58 -0
- package/lib/indexDB/index.d.ts +296 -0
- package/lib/indexDB/index.js +767 -0
- package/lib/locales/en.d.ts +3 -0
- package/lib/locales/en.js +29 -0
- package/lib/locales/index.d.ts +39 -0
- package/lib/locales/index.js +159 -0
- package/lib/locales/original.d.ts +3 -0
- package/lib/locales/original.js +31 -0
- package/lib/locales/type.d.ts +19 -0
- package/lib/locales/type.js +17 -0
- package/lib/locales/zh-CN.d.ts +3 -0
- package/lib/locales/zh-CN.js +29 -0
- package/lib/locales/zh-HK.d.ts +3 -0
- package/lib/locales/zh-HK.js +29 -0
- package/lib/logger/feishu.d.ts +11 -0
- package/lib/logger/feishu.js +52 -0
- package/lib/logger/index.d.ts +135 -0
- package/lib/logger/index.js +476 -0
- package/lib/menuManager/hooks.d.ts +17 -0
- package/lib/menuManager/hooks.js +135 -0
- package/lib/menuManager/index.d.ts +28 -0
- package/lib/menuManager/index.js +125 -0
- package/lib/models/global.d.ts +32 -0
- package/lib/models/global.js +62 -0
- package/lib/models/index.d.ts +45 -0
- package/lib/models/index.js +69 -0
- package/lib/models/type.d.ts +2 -0
- package/lib/models/type.js +17 -0
- package/lib/plugin/index.d.ts +0 -0
- package/lib/plugin/index.js +0 -0
- package/lib/pubsub/example.d.ts +5 -0
- package/lib/pubsub/example.js +61 -0
- package/lib/pubsub/index.d.ts +73 -0
- package/lib/pubsub/index.js +141 -0
- package/lib/render/index.d.ts +0 -0
- package/lib/render/index.js +0 -0
- package/lib/request/cache.d.ts +46 -0
- package/lib/request/cache.js +195 -0
- package/lib/request/cancelToken.d.ts +38 -0
- package/lib/request/cancelToken.js +59 -0
- package/lib/request/config.d.ts +3 -0
- package/lib/request/config.js +69 -0
- package/lib/request/constants.d.ts +2 -0
- package/lib/request/constants.js +34 -0
- package/lib/request/index.d.ts +24 -0
- package/lib/request/index.js +210 -0
- package/lib/request/pisell2Request.d.ts +6 -0
- package/lib/request/pisell2Request.js +75 -0
- package/lib/request/type.d.ts +57 -0
- package/lib/request/type.js +36 -0
- package/lib/request/utils.d.ts +46 -0
- package/lib/request/utils.js +113 -0
- package/lib/routes/config.d.ts +7 -0
- package/lib/routes/config.js +50 -0
- package/lib/routes/index.d.ts +28 -0
- package/lib/routes/index.js +121 -0
- package/lib/socket/components/SocketMonitorPage.d.ts +6 -0
- package/lib/socket/components/SocketMonitorPage.js +340 -0
- package/lib/socket/components/index.d.ts +2 -0
- package/lib/socket/components/index.js +39 -0
- package/lib/socket/constants.d.ts +33 -0
- package/lib/socket/constants.js +62 -0
- package/lib/socket/events.d.ts +31 -0
- package/lib/socket/events.js +44 -0
- package/lib/socket/heartbeat.d.ts +66 -0
- package/lib/socket/heartbeat.js +157 -0
- package/lib/socket/index.d.ts +61 -0
- package/lib/socket/index.js +198 -0
- package/lib/socket/monitor.d.ts +169 -0
- package/lib/socket/monitor.js +350 -0
- package/lib/socket/reconnect.d.ts +61 -0
- package/lib/socket/reconnect.js +157 -0
- package/lib/socket/socket.d.ts +130 -0
- package/lib/socket/socket.js +426 -0
- package/lib/socket/types.d.ts +85 -0
- package/lib/socket/types.js +36 -0
- package/lib/storage/index.d.ts +17 -0
- package/lib/storage/index.js +64 -0
- package/lib/tasks/index.d.ts +127 -0
- package/lib/tasks/index.js +710 -0
- package/lib/tasks/scheduledTasksExample.d.ts +61 -0
- package/lib/tasks/scheduledTasksExample.js +267 -0
- package/lib/tasks/type.d.ts +100 -0
- package/lib/tasks/type.js +17 -0
- package/lib/tasks/useTasks.d.ts +5 -0
- package/lib/tasks/useTasks.js +37 -0
- package/lib/type.d.ts +2 -0
- package/lib/type.js +17 -0
- package/lib/utils/adaptiveThrottle/index.d.ts +36 -0
- package/lib/utils/adaptiveThrottle/index.js +121 -0
- package/lib/variables/VariablesProvider.d.ts +7 -0
- package/lib/variables/VariablesProvider.js +51 -0
- package/lib/variables/config.d.ts +3 -0
- package/lib/variables/config.js +38 -0
- package/lib/variables/index.d.ts +6 -0
- package/lib/variables/index.js +29 -0
- package/lib/variables/type.d.ts +2 -0
- package/lib/variables/type.js +17 -0
- package/lib/website/index.d.ts +6 -0
- package/lib/website/index.js +75 -0
- package/package.json +49 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
+
import { createSignal } from "./cancelToken";
|
|
11
|
+
import { axiosConfig } from "./constants";
|
|
12
|
+
import { cacheFn } from "./cache";
|
|
13
|
+
import { interceptorsRequest, interceptorsResponse, interceptorsRequestError, interceptorsResponseError, requestCallback } from "./utils";
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
import { getUniqueId } from "@pisell/utils";
|
|
16
|
+
import axios from "axios";
|
|
17
|
+
import { getConfig, setConfig } from "./config";
|
|
18
|
+
import { getApp } from "../app";
|
|
19
|
+
// 实例
|
|
20
|
+
var axiosInstance = axios.create(axiosConfig);
|
|
21
|
+
|
|
22
|
+
// 请求拦截器
|
|
23
|
+
axiosInstance.interceptors.request.use(interceptorsRequest, interceptorsRequestError);
|
|
24
|
+
|
|
25
|
+
// 响应拦截器
|
|
26
|
+
axiosInstance.interceptors.response.use(interceptorsResponse, interceptorsResponseError);
|
|
27
|
+
|
|
28
|
+
// 请求计数
|
|
29
|
+
var requestCount = 0;
|
|
30
|
+
var isFilterUrl = function isFilterUrl(url) {
|
|
31
|
+
var _logger$filterUrls;
|
|
32
|
+
var _getConfig = getConfig(),
|
|
33
|
+
logger = _getConfig.logger;
|
|
34
|
+
return logger === null || logger === void 0 || (_logger$filterUrls = logger.filterUrls) === null || _logger$filterUrls === void 0 ? void 0 : _logger$filterUrls.some(function (filterUrl) {
|
|
35
|
+
return url.includes(filterUrl);
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
export var createRequest = function createRequest(props) {
|
|
39
|
+
var data = props.data,
|
|
40
|
+
config = props.config,
|
|
41
|
+
method = props.method,
|
|
42
|
+
url = props.url;
|
|
43
|
+
var _getConfig2 = getConfig(),
|
|
44
|
+
getUrl = _getConfig2.getUrl,
|
|
45
|
+
logger = _getConfig2.logger;
|
|
46
|
+
var startTime = Date.now(); // 记录请求开始时间
|
|
47
|
+
var app = getApp();
|
|
48
|
+
var requestId = getUniqueId();
|
|
49
|
+
|
|
50
|
+
// 请求计数增加
|
|
51
|
+
requestCount++;
|
|
52
|
+
|
|
53
|
+
// 记录请求开始日志
|
|
54
|
+
app.logger.addLog({
|
|
55
|
+
type: 'info',
|
|
56
|
+
title: "[ Request ]: Start - ".concat(requestId),
|
|
57
|
+
metadata: {
|
|
58
|
+
url: url,
|
|
59
|
+
data: data,
|
|
60
|
+
method: method
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// 如果请求计数超过最大请求数,则记录为警告日志
|
|
65
|
+
if (requestCount > ((logger === null || logger === void 0 ? void 0 : logger.maxRequestCount) || 6)) {
|
|
66
|
+
app.logger.addLog({
|
|
67
|
+
type: 'info',
|
|
68
|
+
title: "[ Request ]: Max Request Count - ".concat(requestCount),
|
|
69
|
+
metadata: {
|
|
70
|
+
requestCount: requestCount
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return new Promise(function (resolve, reject) {
|
|
75
|
+
var _method = method === "remove" ? "delete" : method;
|
|
76
|
+
var _url = (getUrl === null || getUrl === void 0 ? void 0 : getUrl(props)) || '';
|
|
77
|
+
|
|
78
|
+
// 请求完成处理函数
|
|
79
|
+
var handleRequestComplete = function handleRequestComplete(url, result) {
|
|
80
|
+
var isError = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
81
|
+
var requestId = arguments.length > 3 ? arguments[3] : undefined;
|
|
82
|
+
try {
|
|
83
|
+
var endTime = Date.now();
|
|
84
|
+
var duration = endTime - startTime;
|
|
85
|
+
var maxRequestTime = (logger === null || logger === void 0 ? void 0 : logger.maxRequestTime) || 5000;
|
|
86
|
+
|
|
87
|
+
// 如果请求URL在过滤列表中,则不判断超时时间
|
|
88
|
+
if (isFilterUrl(url)) {
|
|
89
|
+
maxRequestTime = 99999999;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// 如果请求时间超过最大时间,则记录为警告日志
|
|
93
|
+
var type = duration > maxRequestTime ? 'warning' : 'info';
|
|
94
|
+
|
|
95
|
+
// 如果请求失败,则记录为错误日志
|
|
96
|
+
if (isError) {
|
|
97
|
+
type = 'error';
|
|
98
|
+
}
|
|
99
|
+
app.logger.addLog({
|
|
100
|
+
type: type,
|
|
101
|
+
title: "[ Request ]: Complete - ".concat(requestId, " \u8D85\u8FC75s"),
|
|
102
|
+
metadata: {
|
|
103
|
+
error: isError ? JSON.stringify(result) : '',
|
|
104
|
+
duration: "".concat((duration / 1000).toFixed(2), "s"),
|
|
105
|
+
url: url
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
} catch (error) {}
|
|
109
|
+
return result;
|
|
110
|
+
};
|
|
111
|
+
axiosInstance[_method](_url, ["post", "put"].includes(_method) ? data : _objectSpread({
|
|
112
|
+
params: data
|
|
113
|
+
}, config), _objectSpread({
|
|
114
|
+
params: !["post", "put"].includes(_method) ? data : null
|
|
115
|
+
}, config)).then(function (res) {
|
|
116
|
+
handleRequestComplete(_url, res, false, requestId);
|
|
117
|
+
requestCallback({
|
|
118
|
+
res: res,
|
|
119
|
+
reject: reject,
|
|
120
|
+
resolve: resolve,
|
|
121
|
+
props: props
|
|
122
|
+
});
|
|
123
|
+
}).catch(function (err) {
|
|
124
|
+
handleRequestComplete(_url, err, true, requestId);
|
|
125
|
+
requestCallback({
|
|
126
|
+
err: err,
|
|
127
|
+
reject: reject,
|
|
128
|
+
resolve: resolve,
|
|
129
|
+
props: props
|
|
130
|
+
});
|
|
131
|
+
}).finally(function () {
|
|
132
|
+
requestCount--;
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* 请求
|
|
139
|
+
* @param props
|
|
140
|
+
* @returns
|
|
141
|
+
*/
|
|
142
|
+
export var request = function request(props) {
|
|
143
|
+
var config = props.config,
|
|
144
|
+
url = props.url,
|
|
145
|
+
method = props.method;
|
|
146
|
+
// 请求防抖
|
|
147
|
+
if (config !== null && config !== void 0 && config.abort) {
|
|
148
|
+
var signal = createSignal(config.abort, url);
|
|
149
|
+
config.signal = signal;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// 使用os服务层
|
|
153
|
+
if (config !== null && config !== void 0 && config.osServer) {
|
|
154
|
+
var _app$getPisellos, _pisellos$server, _pisellos$server$hasR;
|
|
155
|
+
var app = getApp();
|
|
156
|
+
var pisellos = (_app$getPisellos = app.getPisellos) === null || _app$getPisellos === void 0 ? void 0 : _app$getPisellos.call(app);
|
|
157
|
+
if (pisellos !== null && pisellos !== void 0 && pisellos.server && pisellos !== null && pisellos !== void 0 && (_pisellos$server = pisellos.server) !== null && _pisellos$server !== void 0 && (_pisellos$server$hasR = _pisellos$server.hasRoute) !== null && _pisellos$server$hasR !== void 0 && _pisellos$server$hasR.call(_pisellos$server, method, url)) {
|
|
158
|
+
var _pisellos$server2, _pisellos$server2$han;
|
|
159
|
+
return pisellos === null || pisellos === void 0 || (_pisellos$server2 = pisellos.server) === null || _pisellos$server2 === void 0 || (_pisellos$server2$han = _pisellos$server2.handleRoute) === null || _pisellos$server2$han === void 0 ? void 0 : _pisellos$server2$han.call(_pisellos$server2, method, url, props);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// 缓存函数
|
|
164
|
+
return cacheFn(props, createRequest);
|
|
165
|
+
};
|
|
166
|
+
export var get = /*#__PURE__*/function () {
|
|
167
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(url, data, config) {
|
|
168
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
169
|
+
while (1) switch (_context.prev = _context.next) {
|
|
170
|
+
case 0:
|
|
171
|
+
return _context.abrupt("return", request({
|
|
172
|
+
method: "get",
|
|
173
|
+
url: url,
|
|
174
|
+
data: data,
|
|
175
|
+
config: config
|
|
176
|
+
}));
|
|
177
|
+
case 1:
|
|
178
|
+
case "end":
|
|
179
|
+
return _context.stop();
|
|
180
|
+
}
|
|
181
|
+
}, _callee);
|
|
182
|
+
}));
|
|
183
|
+
return function get(_x, _x2, _x3) {
|
|
184
|
+
return _ref.apply(this, arguments);
|
|
185
|
+
};
|
|
186
|
+
}();
|
|
187
|
+
export var post = /*#__PURE__*/function () {
|
|
188
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(url, data, config) {
|
|
189
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
190
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
191
|
+
case 0:
|
|
192
|
+
return _context2.abrupt("return", request({
|
|
193
|
+
method: "post",
|
|
194
|
+
url: url,
|
|
195
|
+
data: data,
|
|
196
|
+
config: config
|
|
197
|
+
}));
|
|
198
|
+
case 1:
|
|
199
|
+
case "end":
|
|
200
|
+
return _context2.stop();
|
|
201
|
+
}
|
|
202
|
+
}, _callee2);
|
|
203
|
+
}));
|
|
204
|
+
return function post(_x4, _x5, _x6) {
|
|
205
|
+
return _ref2.apply(this, arguments);
|
|
206
|
+
};
|
|
207
|
+
}();
|
|
208
|
+
export var put = /*#__PURE__*/function () {
|
|
209
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(url, data, config) {
|
|
210
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
211
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
212
|
+
case 0:
|
|
213
|
+
return _context3.abrupt("return", request({
|
|
214
|
+
method: "put",
|
|
215
|
+
url: url,
|
|
216
|
+
data: data,
|
|
217
|
+
config: config
|
|
218
|
+
}));
|
|
219
|
+
case 1:
|
|
220
|
+
case "end":
|
|
221
|
+
return _context3.stop();
|
|
222
|
+
}
|
|
223
|
+
}, _callee3);
|
|
224
|
+
}));
|
|
225
|
+
return function put(_x7, _x8, _x9) {
|
|
226
|
+
return _ref3.apply(this, arguments);
|
|
227
|
+
};
|
|
228
|
+
}();
|
|
229
|
+
export var remove = /*#__PURE__*/function () {
|
|
230
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(url, data, config) {
|
|
231
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
232
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
233
|
+
case 0:
|
|
234
|
+
return _context4.abrupt("return", request({
|
|
235
|
+
method: "remove",
|
|
236
|
+
url: url,
|
|
237
|
+
data: data,
|
|
238
|
+
config: config
|
|
239
|
+
}));
|
|
240
|
+
case 1:
|
|
241
|
+
case "end":
|
|
242
|
+
return _context4.stop();
|
|
243
|
+
}
|
|
244
|
+
}, _callee4);
|
|
245
|
+
}));
|
|
246
|
+
return function remove(_x10, _x11, _x12) {
|
|
247
|
+
return _ref4.apply(this, arguments);
|
|
248
|
+
};
|
|
249
|
+
}();
|
|
250
|
+
export var custom = function custom(url, config) {
|
|
251
|
+
return request({
|
|
252
|
+
url: url,
|
|
253
|
+
method: config === null || config === void 0 ? void 0 : config.method,
|
|
254
|
+
data: config === null || config === void 0 ? void 0 : config.data,
|
|
255
|
+
config: config
|
|
256
|
+
});
|
|
257
|
+
};
|
|
258
|
+
export * from "./type";
|
|
259
|
+
export default {
|
|
260
|
+
get: get,
|
|
261
|
+
post: post,
|
|
262
|
+
put: put,
|
|
263
|
+
remove: remove,
|
|
264
|
+
custom: custom,
|
|
265
|
+
setConfig: setConfig,
|
|
266
|
+
getConfig: getConfig
|
|
267
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare type RequestMethod = any;
|
|
2
|
+
declare const pisell2Get: RequestMethod;
|
|
3
|
+
declare const pisell2Post: RequestMethod;
|
|
4
|
+
declare const pisell2Put: RequestMethod;
|
|
5
|
+
declare const pisell2Remove: RequestMethod;
|
|
6
|
+
export { pisell2Get as get, pisell2Post as post, pisell2Put as put, pisell2Remove as remove, };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { get, post, put, remove } from "./index";
|
|
8
|
+
var pisell2Get = function pisell2Get(url) {
|
|
9
|
+
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10
|
+
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
11
|
+
return get(url, data, _objectSpread(_objectSpread({}, config), {}, {
|
|
12
|
+
pisell2: true,
|
|
13
|
+
headers: _objectSpread(_objectSpread({}, (config === null || config === void 0 ? void 0 : config.headers) || {}), {}, {
|
|
14
|
+
Accept: '*/json'
|
|
15
|
+
})
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
var pisell2Post = function pisell2Post(url) {
|
|
19
|
+
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
20
|
+
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
21
|
+
return post(url, data, _objectSpread(_objectSpread({}, config), {}, {
|
|
22
|
+
pisell2: true,
|
|
23
|
+
headers: _objectSpread(_objectSpread({}, (config === null || config === void 0 ? void 0 : config.headers) || {}), {}, {
|
|
24
|
+
Accept: '*/json'
|
|
25
|
+
})
|
|
26
|
+
}));
|
|
27
|
+
};
|
|
28
|
+
var pisell2Put = function pisell2Put(url) {
|
|
29
|
+
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
30
|
+
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
31
|
+
return put(url, data, _objectSpread(_objectSpread({}, config), {}, {
|
|
32
|
+
pisell2: true,
|
|
33
|
+
headers: _objectSpread(_objectSpread({}, (config === null || config === void 0 ? void 0 : config.headers) || {}), {}, {
|
|
34
|
+
Accept: '*/json'
|
|
35
|
+
})
|
|
36
|
+
}));
|
|
37
|
+
};
|
|
38
|
+
var pisell2Remove = function pisell2Remove(url) {
|
|
39
|
+
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
40
|
+
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
41
|
+
return remove(url, data, _objectSpread(_objectSpread({}, config), {}, {
|
|
42
|
+
pisell2: true,
|
|
43
|
+
headers: _objectSpread(_objectSpread({}, (config === null || config === void 0 ? void 0 : config.headers) || {}), {}, {
|
|
44
|
+
Accept: '*/json'
|
|
45
|
+
})
|
|
46
|
+
}));
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// const pisell2Custom: RequestMethod = <T>(url: string, config: any) => {
|
|
50
|
+
// return custom(url, {
|
|
51
|
+
// ...config,
|
|
52
|
+
// pisell2: true,
|
|
53
|
+
// headers: {
|
|
54
|
+
// ...((config as any)?.headers || {}),
|
|
55
|
+
// Accept: '*/json',
|
|
56
|
+
// },
|
|
57
|
+
// });
|
|
58
|
+
// };
|
|
59
|
+
|
|
60
|
+
export { pisell2Get as get, pisell2Post as post, pisell2Put as put, pisell2Remove as remove
|
|
61
|
+
// pisell2Custom as custom,
|
|
62
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { CreateAxiosDefaults } from "axios";
|
|
2
|
+
import { CacheType } from './cache';
|
|
3
|
+
export interface RequestConfig {
|
|
4
|
+
logger: {
|
|
5
|
+
maxRequestCount: number;
|
|
6
|
+
maxRequestTime: number;
|
|
7
|
+
filterUrls: string[];
|
|
8
|
+
};
|
|
9
|
+
interceptorsRequest?: ((value: any) => any | Promise<any>) | null;
|
|
10
|
+
interceptorsRequestError?: ((error: any) => any) | null;
|
|
11
|
+
interceptorsResponse?: any;
|
|
12
|
+
interceptorsResponseError?: ((error: any) => any) | null;
|
|
13
|
+
axiosConfig?: CreateAxiosDefaults;
|
|
14
|
+
storage?: any;
|
|
15
|
+
getToken?: () => string | null;
|
|
16
|
+
setToken?: (token: string) => void;
|
|
17
|
+
getLocale?: () => string | null;
|
|
18
|
+
getUrl?: (config: any) => string;
|
|
19
|
+
requestCallbacks?: {
|
|
20
|
+
200?: (data: any) => void;
|
|
21
|
+
401?: (data: any) => void;
|
|
22
|
+
403?: (data: any) => void;
|
|
23
|
+
other?: (data: any) => void;
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export declare enum RequestModeENUM {
|
|
28
|
+
LOCAL = "local",
|
|
29
|
+
REMOTE = "remote",
|
|
30
|
+
LOCAL_REMOTE = "local_remote",
|
|
31
|
+
REMOTE_LOCAL = "remote_local",
|
|
32
|
+
OS_SERVER = "os_server"
|
|
33
|
+
}
|
|
34
|
+
export declare type RequestModeType = RequestModeENUM.LOCAL | RequestModeENUM.REMOTE | RequestModeENUM.LOCAL_REMOTE | RequestModeENUM.REMOTE_LOCAL | RequestModeENUM.OS_SERVER;
|
|
35
|
+
export interface CacheProps {
|
|
36
|
+
key?: string;
|
|
37
|
+
type?: CacheType;
|
|
38
|
+
updateCache?: boolean;
|
|
39
|
+
cacheUpdateChange?: (data: any) => void;
|
|
40
|
+
mode?: RequestModeType;
|
|
41
|
+
cacheKeyData?: any;
|
|
42
|
+
}
|
|
43
|
+
export interface RequestSetting {
|
|
44
|
+
abort?: boolean;
|
|
45
|
+
headers?: any;
|
|
46
|
+
cache?: CacheProps;
|
|
47
|
+
signal?: any;
|
|
48
|
+
token?: string;
|
|
49
|
+
osServer?: boolean;
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
}
|
|
52
|
+
export interface RequestWrapperProps {
|
|
53
|
+
url: string;
|
|
54
|
+
method: 'get' | 'post' | 'remove' | 'put';
|
|
55
|
+
data?: any;
|
|
56
|
+
config?: RequestSetting;
|
|
57
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export var RequestModeENUM = /*#__PURE__*/function (RequestModeENUM) {
|
|
2
|
+
RequestModeENUM["LOCAL"] = "local";
|
|
3
|
+
RequestModeENUM["REMOTE"] = "remote";
|
|
4
|
+
RequestModeENUM["LOCAL_REMOTE"] = "local_remote";
|
|
5
|
+
RequestModeENUM["REMOTE_LOCAL"] = "remote_local";
|
|
6
|
+
RequestModeENUM["OS_SERVER"] = "os_server";
|
|
7
|
+
return RequestModeENUM;
|
|
8
|
+
}({});
|
|
9
|
+
|
|
10
|
+
// 请求模式
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { InternalAxiosRequestConfig } from "axios";
|
|
2
|
+
import { RequestSetting, RequestConfig, RequestWrapperProps } from "./type";
|
|
3
|
+
export declare const getRequestHeaders: (config: InternalAxiosRequestConfig<RequestSetting> & Record<string, any>) => Record<string, string | null>;
|
|
4
|
+
/**
|
|
5
|
+
* @title: 请求前拦截
|
|
6
|
+
* @description:
|
|
7
|
+
* @param {any} config
|
|
8
|
+
* @return {*}
|
|
9
|
+
* @Author: zhiwei.Wang
|
|
10
|
+
* @Date: 2024-07-04 10:51
|
|
11
|
+
*/
|
|
12
|
+
export declare const interceptorsRequest: (config: InternalAxiosRequestConfig<RequestSetting> & Record<string, any>) => Promise<InternalAxiosRequestConfig<RequestSetting> & Record<string, any>>;
|
|
13
|
+
/**
|
|
14
|
+
* @title: 请求前error
|
|
15
|
+
* @description:
|
|
16
|
+
* @param {any} err
|
|
17
|
+
* @return {*}
|
|
18
|
+
* @Author: zhiwei.Wang
|
|
19
|
+
* @Date: 2024-07-04 10:51
|
|
20
|
+
*/
|
|
21
|
+
export declare const interceptorsRequestError: (err: RequestConfig["interceptorsRequestError"]) => any;
|
|
22
|
+
/**
|
|
23
|
+
* @title: 请求后拦截
|
|
24
|
+
* @description:
|
|
25
|
+
* @param {any} response
|
|
26
|
+
* @return {*}
|
|
27
|
+
* @Author: zhiwei.Wang
|
|
28
|
+
* @Date: 2024-07-04 10:51
|
|
29
|
+
*/
|
|
30
|
+
export declare const interceptorsResponse: (response: RequestConfig["interceptorsResponse"]) => any;
|
|
31
|
+
/**
|
|
32
|
+
* @title: 请求后错误拦截
|
|
33
|
+
* @description:
|
|
34
|
+
* @param {any} response
|
|
35
|
+
* @return {*}
|
|
36
|
+
* @Author: zhiwei.Wang
|
|
37
|
+
* @Date: 2024-07-04 10:51
|
|
38
|
+
*/
|
|
39
|
+
export declare const interceptorsResponseError: (response: RequestConfig["interceptorsResponseError"]) => any;
|
|
40
|
+
export declare const requestCallback: (resData: {
|
|
41
|
+
res?: any;
|
|
42
|
+
props: RequestWrapperProps;
|
|
43
|
+
resolve: (value: unknown) => void;
|
|
44
|
+
reject: () => void;
|
|
45
|
+
err?: any;
|
|
46
|
+
}) => void;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
import { setCacheData } from "./cache";
|
|
6
|
+
import { getConfig } from "./config";
|
|
7
|
+
export var getRequestHeaders = function getRequestHeaders(config) {
|
|
8
|
+
var _getConfig = getConfig(),
|
|
9
|
+
getToken = _getConfig.getToken,
|
|
10
|
+
getLocale = _getConfig.getLocale,
|
|
11
|
+
getUrl = _getConfig.getUrl;
|
|
12
|
+
var token = getToken === null || getToken === void 0 ? void 0 : getToken();
|
|
13
|
+
var authorization = (config === null || config === void 0 ? void 0 : config.token) || token || "";
|
|
14
|
+
var headers = {
|
|
15
|
+
Accept: "*/json",
|
|
16
|
+
Timezone: "Australia/Sydney",
|
|
17
|
+
// 'X-Timezone': "+00:00",
|
|
18
|
+
locale: getLocale === null || getLocale === void 0 ? void 0 : getLocale(),
|
|
19
|
+
authorization: authorization
|
|
20
|
+
};
|
|
21
|
+
if (config !== null && config !== void 0 && config.third) {
|
|
22
|
+
headers.authorization = null;
|
|
23
|
+
}
|
|
24
|
+
return headers;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @title: 请求前拦截
|
|
29
|
+
* @description:
|
|
30
|
+
* @param {any} config
|
|
31
|
+
* @return {*}
|
|
32
|
+
* @Author: zhiwei.Wang
|
|
33
|
+
* @Date: 2024-07-04 10:51
|
|
34
|
+
*/
|
|
35
|
+
export var interceptorsRequest = /*#__PURE__*/function () {
|
|
36
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config) {
|
|
37
|
+
var _getConfig2, getUrl, headers, _interceptorsRequest;
|
|
38
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
_getConfig2 = getConfig(), getUrl = _getConfig2.getUrl;
|
|
42
|
+
config.url = getUrl === null || getUrl === void 0 ? void 0 : getUrl(config);
|
|
43
|
+
headers = getRequestHeaders(config);
|
|
44
|
+
config.headers["authorization"] = headers.authorization;
|
|
45
|
+
config.headers["locale"] = headers.locale;
|
|
46
|
+
_interceptorsRequest = getConfig().interceptorsRequest;
|
|
47
|
+
if (!_interceptorsRequest) {
|
|
48
|
+
_context.next = 10;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
_context.next = 9;
|
|
52
|
+
return _interceptorsRequest(config);
|
|
53
|
+
case 9:
|
|
54
|
+
config = _context.sent;
|
|
55
|
+
case 10:
|
|
56
|
+
return _context.abrupt("return", config);
|
|
57
|
+
case 11:
|
|
58
|
+
case "end":
|
|
59
|
+
return _context.stop();
|
|
60
|
+
}
|
|
61
|
+
}, _callee);
|
|
62
|
+
}));
|
|
63
|
+
return function interceptorsRequest(_x) {
|
|
64
|
+
return _ref.apply(this, arguments);
|
|
65
|
+
};
|
|
66
|
+
}();
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @title: 请求前error
|
|
70
|
+
* @description:
|
|
71
|
+
* @param {any} err
|
|
72
|
+
* @return {*}
|
|
73
|
+
* @Author: zhiwei.Wang
|
|
74
|
+
* @Date: 2024-07-04 10:51
|
|
75
|
+
*/
|
|
76
|
+
export var interceptorsRequestError = function interceptorsRequestError(err) {
|
|
77
|
+
var _getConfig$intercepto, _getConfig3;
|
|
78
|
+
return (_getConfig$intercepto = (_getConfig3 = getConfig()).interceptorsRequestError) === null || _getConfig$intercepto === void 0 ? void 0 : _getConfig$intercepto.call(_getConfig3, err);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @title: 请求后拦截
|
|
83
|
+
* @description:
|
|
84
|
+
* @param {any} response
|
|
85
|
+
* @return {*}
|
|
86
|
+
* @Author: zhiwei.Wang
|
|
87
|
+
* @Date: 2024-07-04 10:51
|
|
88
|
+
*/
|
|
89
|
+
export var interceptorsResponse = function interceptorsResponse(response) {
|
|
90
|
+
var _interceptorsResponse = getConfig().interceptorsResponse;
|
|
91
|
+
|
|
92
|
+
// 置换token
|
|
93
|
+
var Authorization = response.headers['Authorization'];
|
|
94
|
+
if (Authorization) {
|
|
95
|
+
var _getConfig4 = getConfig(),
|
|
96
|
+
setToken = _getConfig4.setToken;
|
|
97
|
+
setToken === null || setToken === void 0 || setToken(Authorization);
|
|
98
|
+
}
|
|
99
|
+
if (_interceptorsResponse) {
|
|
100
|
+
return _interceptorsResponse(response);
|
|
101
|
+
}
|
|
102
|
+
return response === null || response === void 0 ? void 0 : response.data;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* @title: 请求后错误拦截
|
|
107
|
+
* @description:
|
|
108
|
+
* @param {any} response
|
|
109
|
+
* @return {*}
|
|
110
|
+
* @Author: zhiwei.Wang
|
|
111
|
+
* @Date: 2024-07-04 10:51
|
|
112
|
+
*/
|
|
113
|
+
export var interceptorsResponseError = function interceptorsResponseError(response) {
|
|
114
|
+
var _getConfig$intercepto2, _getConfig5;
|
|
115
|
+
return (_getConfig$intercepto2 = (_getConfig5 = getConfig()).interceptorsResponseError) === null || _getConfig$intercepto2 === void 0 ? void 0 : _getConfig$intercepto2.call(_getConfig5, response);
|
|
116
|
+
};
|
|
117
|
+
export var requestCallback = function requestCallback(resData) {
|
|
118
|
+
var res = resData.res,
|
|
119
|
+
props = resData.props,
|
|
120
|
+
resolve = resData.resolve,
|
|
121
|
+
reject = resData.reject,
|
|
122
|
+
err = resData.err;
|
|
123
|
+
try {
|
|
124
|
+
var config = props.config;
|
|
125
|
+
var _getConfig6 = getConfig(),
|
|
126
|
+
requestCallbacks = _getConfig6.requestCallbacks;
|
|
127
|
+
var codeFn = requestCallbacks === null || requestCallbacks === void 0 ? void 0 : requestCallbacks[res === null || res === void 0 ? void 0 : res.code];
|
|
128
|
+
if (codeFn) {
|
|
129
|
+
if ((res === null || res === void 0 ? void 0 : res.code) === 200) {
|
|
130
|
+
// 需要缓存的进行缓存数据
|
|
131
|
+
if (config !== null && config !== void 0 && config.useCache || config !== null && config !== void 0 && config.cache) {
|
|
132
|
+
var _config$cacheUpdateCh;
|
|
133
|
+
setCacheData(props.url, props.data, res, config === null || config === void 0 ? void 0 : config.cache);
|
|
134
|
+
config === null || config === void 0 || (_config$cacheUpdateCh = config.cacheUpdateChange) === null || _config$cacheUpdateCh === void 0 || _config$cacheUpdateCh.call(config, res);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return codeFn(resData);
|
|
138
|
+
}
|
|
139
|
+
var otherFn = requestCallbacks === null || requestCallbacks === void 0 ? void 0 : requestCallbacks["other"];
|
|
140
|
+
if (otherFn) {
|
|
141
|
+
return otherFn(resData);
|
|
142
|
+
}
|
|
143
|
+
} catch (err) {
|
|
144
|
+
console.log("requestCallback err", err);
|
|
145
|
+
}
|
|
146
|
+
reject();
|
|
147
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export var routes = [{
|
|
2
|
+
path: "/",
|
|
3
|
+
component: '../pages/Theme',
|
|
4
|
+
exact: true
|
|
5
|
+
}, {
|
|
6
|
+
path: "/test",
|
|
7
|
+
component: '../pages/Test',
|
|
8
|
+
exact: true
|
|
9
|
+
}, {
|
|
10
|
+
path: "/pay",
|
|
11
|
+
component: '../pages/Pay',
|
|
12
|
+
exact: true
|
|
13
|
+
}, {
|
|
14
|
+
path: "/lc/:id",
|
|
15
|
+
component: '../pages/LowCodePage',
|
|
16
|
+
exact: true
|
|
17
|
+
}];
|