@pisell/core 1.0.24 → 1.0.25
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/es/app/app.d.ts +2 -2
- package/es/app/app.js +3 -3
- package/es/request/index.js +5 -4
- package/lib/app/app.d.ts +2 -2
- package/lib/app/app.js +3 -3
- package/lib/request/index.js +4 -3
- package/package.json +1 -1
package/es/app/app.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface AppOptions {
|
|
|
22
22
|
history?: HistoryOptions;
|
|
23
23
|
storage?: StorageOptions;
|
|
24
24
|
locales?: LocalesOptions;
|
|
25
|
-
|
|
25
|
+
getPisellos?: () => any;
|
|
26
26
|
}
|
|
27
27
|
declare class App {
|
|
28
28
|
private static instance;
|
|
@@ -67,7 +67,7 @@ declare class App {
|
|
|
67
67
|
cmd: CMD;
|
|
68
68
|
aws: AWS;
|
|
69
69
|
tasksManager: TasksManager;
|
|
70
|
-
|
|
70
|
+
getPisellos: any;
|
|
71
71
|
dbManager: IndexDBManager | null;
|
|
72
72
|
constants: {
|
|
73
73
|
channel: string;
|
package/es/app/app.js
CHANGED
|
@@ -67,8 +67,8 @@ var App = /*#__PURE__*/function () {
|
|
|
67
67
|
_defineProperty(this, "aws", void 0);
|
|
68
68
|
// 任务管理
|
|
69
69
|
_defineProperty(this, "tasksManager", void 0);
|
|
70
|
-
//
|
|
71
|
-
_defineProperty(this, "
|
|
70
|
+
// getPisellos
|
|
71
|
+
_defineProperty(this, "getPisellos", void 0);
|
|
72
72
|
_defineProperty(this, "dbManager", null);
|
|
73
73
|
_defineProperty(this, "constants", {
|
|
74
74
|
channel: ""
|
|
@@ -89,7 +89,7 @@ var App = /*#__PURE__*/function () {
|
|
|
89
89
|
this.tasksManager = new TasksManager(this);
|
|
90
90
|
this.cmd = new CMD(this, options === null || options === void 0 ? void 0 : options.cmd);
|
|
91
91
|
this.aws = new AWS(this, options === null || options === void 0 ? void 0 : options.aws);
|
|
92
|
-
this.
|
|
92
|
+
this.getPisellos = options === null || options === void 0 ? void 0 : options.getPisellos;
|
|
93
93
|
if (options !== null && options !== void 0 && options.constants) {
|
|
94
94
|
this.constants = options.constants || {};
|
|
95
95
|
}
|
package/es/request/index.js
CHANGED
|
@@ -70,11 +70,12 @@ export var request = function request(props) {
|
|
|
70
70
|
|
|
71
71
|
// 使用os服务层
|
|
72
72
|
if (config !== null && config !== void 0 && config.osServer) {
|
|
73
|
-
var _app$
|
|
73
|
+
var _app$getPisellos, _pisellos$server, _pisellos$server$hasR;
|
|
74
74
|
var app = getApp();
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
var pisellos = (_app$getPisellos = app.getPisellos) === null || _app$getPisellos === void 0 ? void 0 : _app$getPisellos.call(app);
|
|
76
|
+
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)) {
|
|
77
|
+
var _pisellos$server2, _pisellos$server2$han;
|
|
78
|
+
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);
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
|
package/lib/app/app.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface AppOptions {
|
|
|
22
22
|
history?: HistoryOptions;
|
|
23
23
|
storage?: StorageOptions;
|
|
24
24
|
locales?: LocalesOptions;
|
|
25
|
-
|
|
25
|
+
getPisellos?: () => any;
|
|
26
26
|
}
|
|
27
27
|
declare class App {
|
|
28
28
|
private static instance;
|
|
@@ -67,7 +67,7 @@ declare class App {
|
|
|
67
67
|
cmd: CMD;
|
|
68
68
|
aws: AWS;
|
|
69
69
|
tasksManager: TasksManager;
|
|
70
|
-
|
|
70
|
+
getPisellos: any;
|
|
71
71
|
dbManager: IndexDBManager | null;
|
|
72
72
|
constants: {
|
|
73
73
|
channel: string;
|
package/lib/app/app.js
CHANGED
|
@@ -92,8 +92,8 @@ var App = class _App {
|
|
|
92
92
|
aws;
|
|
93
93
|
// 任务管理
|
|
94
94
|
tasksManager;
|
|
95
|
-
//
|
|
96
|
-
|
|
95
|
+
// getPisellos
|
|
96
|
+
getPisellos;
|
|
97
97
|
dbManager = null;
|
|
98
98
|
constants = {
|
|
99
99
|
channel: ""
|
|
@@ -115,7 +115,7 @@ var App = class _App {
|
|
|
115
115
|
this.tasksManager = new import_tasks.TasksManager(this);
|
|
116
116
|
this.cmd = new import_cmd.default(this, options == null ? void 0 : options.cmd);
|
|
117
117
|
this.aws = new import_aws.default(this, options == null ? void 0 : options.aws);
|
|
118
|
-
this.
|
|
118
|
+
this.getPisellos = options == null ? void 0 : options.getPisellos;
|
|
119
119
|
if (options == null ? void 0 : options.constants) {
|
|
120
120
|
this.constants = options.constants || {};
|
|
121
121
|
}
|
package/lib/request/index.js
CHANGED
|
@@ -75,7 +75,7 @@ var createRequest = (props) => {
|
|
|
75
75
|
});
|
|
76
76
|
};
|
|
77
77
|
var request = (props) => {
|
|
78
|
-
var _a, _b, _c, _d, _e
|
|
78
|
+
var _a, _b, _c, _d, _e;
|
|
79
79
|
const { config, url, method } = props;
|
|
80
80
|
if (config == null ? void 0 : config.abort) {
|
|
81
81
|
let signal = (0, import_cancelToken.createSignal)(config.abort, url);
|
|
@@ -83,8 +83,9 @@ var request = (props) => {
|
|
|
83
83
|
}
|
|
84
84
|
if (config == null ? void 0 : config.osServer) {
|
|
85
85
|
const app = (0, import_app.getApp)();
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
const pisellos = (_a = app.getPisellos) == null ? void 0 : _a.call(app);
|
|
87
|
+
if ((pisellos == null ? void 0 : pisellos.server) && ((_c = (_b = pisellos == null ? void 0 : pisellos.server) == null ? void 0 : _b.hasRoute) == null ? void 0 : _c.call(_b, method, url))) {
|
|
88
|
+
return (_e = (_d = pisellos == null ? void 0 : pisellos.server) == null ? void 0 : _d.handleRoute) == null ? void 0 : _e.call(_d, method, url, props);
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
return (0, import_cache.cacheFn)(props, createRequest);
|