@nocobase/plugin-client 0.8.0-alpha.9 → 0.8.1-alpha.3
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/lib/server.js +13 -3
- package/package.json +4 -4
package/lib/server.js
CHANGED
|
@@ -101,6 +101,8 @@ class ClientPlugin extends _server().Plugin {
|
|
|
101
101
|
|
|
102
102
|
_this2.app.acl.allow('plugins', 'getPinned', 'loggedIn');
|
|
103
103
|
|
|
104
|
+
const dialect = _this2.app.db.sequelize.getDialect();
|
|
105
|
+
|
|
104
106
|
_this2.app.resource({
|
|
105
107
|
name: 'app',
|
|
106
108
|
actions: {
|
|
@@ -117,6 +119,9 @@ class ClientPlugin extends _server().Plugin {
|
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
ctx.body = {
|
|
122
|
+
database: {
|
|
123
|
+
dialect
|
|
124
|
+
},
|
|
120
125
|
version: yield ctx.app.version.get(),
|
|
121
126
|
lang
|
|
122
127
|
};
|
|
@@ -153,7 +158,9 @@ class ClientPlugin extends _server().Plugin {
|
|
|
153
158
|
});
|
|
154
159
|
ctx.body = items.filter(item => {
|
|
155
160
|
try {
|
|
156
|
-
|
|
161
|
+
const packageName = _server().PluginManager.getPackageName(item.name);
|
|
162
|
+
|
|
163
|
+
require.resolve(`${packageName}/client`);
|
|
157
164
|
|
|
158
165
|
return true;
|
|
159
166
|
} catch (error) {}
|
|
@@ -200,7 +207,7 @@ class ClientPlugin extends _server().Plugin {
|
|
|
200
207
|
}
|
|
201
208
|
|
|
202
209
|
if (process.env.APP_ENV !== 'production' && root) {
|
|
203
|
-
_this2.app.
|
|
210
|
+
_this2.app.use( /*#__PURE__*/function () {
|
|
204
211
|
var _ref4 = _asyncToGenerator(function* (ctx, next) {
|
|
205
212
|
if (ctx.path.startsWith(_this2.app.resourcer.options.prefix)) {
|
|
206
213
|
return next();
|
|
@@ -218,7 +225,10 @@ class ClientPlugin extends _server().Plugin {
|
|
|
218
225
|
return function (_x3, _x4) {
|
|
219
226
|
return _ref4.apply(this, arguments);
|
|
220
227
|
};
|
|
221
|
-
}()
|
|
228
|
+
}(), {
|
|
229
|
+
tag: 'clientStatic',
|
|
230
|
+
before: 'cors'
|
|
231
|
+
});
|
|
222
232
|
}
|
|
223
233
|
})();
|
|
224
234
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-client",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1-alpha.3",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"licenses": [
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
}
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@nocobase/server": "0.8.
|
|
13
|
+
"@nocobase/server": "0.8.1-alpha.3"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@nocobase/test": "0.8.
|
|
16
|
+
"@nocobase/test": "0.8.1-alpha.3"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "e03df3df5962b99d9fbf5b6e33fbe2b23f14f3d3"
|
|
19
19
|
}
|