@nocobase/plugin-client 0.7.0-alpha.82 → 0.7.1-alpha.4
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/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/{plugin.d.ts → server.d.ts} +0 -0
- package/lib/{plugin.js → server.js} +19 -5
- package/package.json +4 -4
package/lib/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './
|
|
1
|
+
export { default } from './server';
|
package/lib/index.js
CHANGED
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _server.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _server = _interopRequireDefault(require("./server"));
|
|
14
14
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
File without changes
|
|
@@ -95,21 +95,28 @@ class ClientPlugin extends _server().Plugin {
|
|
|
95
95
|
return _asyncToGenerator(function* () {
|
|
96
96
|
_this2.app.acl.allow('app', 'getLang');
|
|
97
97
|
|
|
98
|
+
_this2.app.acl.allow('app', 'getInfo');
|
|
99
|
+
|
|
98
100
|
_this2.app.acl.allow('plugins', 'getPinned', 'loggedIn');
|
|
99
101
|
|
|
100
102
|
_this2.app.resource({
|
|
101
103
|
name: 'app',
|
|
102
104
|
actions: {
|
|
103
105
|
getInfo(ctx, next) {
|
|
104
|
-
var _this3 = this;
|
|
105
|
-
|
|
106
106
|
return _asyncToGenerator(function* () {
|
|
107
107
|
const SystemSetting = ctx.db.getRepository('systemSettings');
|
|
108
108
|
const systemSetting = yield SystemSetting.findOne();
|
|
109
|
+
const enabledLanguages = systemSetting.get('enabledLanguages') || [];
|
|
109
110
|
const currentUser = ctx.state.currentUser;
|
|
111
|
+
let lang = (systemSetting === null || systemSetting === void 0 ? void 0 : systemSetting.appLang) || process.env.APP_LANG || 'en-US';
|
|
112
|
+
|
|
113
|
+
if (enabledLanguages.includes(currentUser === null || currentUser === void 0 ? void 0 : currentUser.appLang)) {
|
|
114
|
+
lang = currentUser === null || currentUser === void 0 ? void 0 : currentUser.appLang;
|
|
115
|
+
}
|
|
116
|
+
|
|
110
117
|
ctx.body = {
|
|
111
|
-
version:
|
|
112
|
-
lang
|
|
118
|
+
version: yield ctx.app.version.get(),
|
|
119
|
+
lang
|
|
113
120
|
};
|
|
114
121
|
yield next();
|
|
115
122
|
})();
|
|
@@ -119,9 +126,16 @@ class ClientPlugin extends _server().Plugin {
|
|
|
119
126
|
return _asyncToGenerator(function* () {
|
|
120
127
|
const SystemSetting = ctx.db.getRepository('systemSettings');
|
|
121
128
|
const systemSetting = yield SystemSetting.findOne();
|
|
129
|
+
const enabledLanguages = systemSetting.get('enabledLanguages') || [];
|
|
122
130
|
const currentUser = ctx.state.currentUser;
|
|
131
|
+
let lang = (systemSetting === null || systemSetting === void 0 ? void 0 : systemSetting.appLang) || process.env.APP_LANG || 'en-US';
|
|
132
|
+
|
|
133
|
+
if (enabledLanguages.includes(currentUser === null || currentUser === void 0 ? void 0 : currentUser.appLang)) {
|
|
134
|
+
lang = currentUser === null || currentUser === void 0 ? void 0 : currentUser.appLang;
|
|
135
|
+
}
|
|
136
|
+
|
|
123
137
|
ctx.body = {
|
|
124
|
-
lang
|
|
138
|
+
lang
|
|
125
139
|
};
|
|
126
140
|
yield next();
|
|
127
141
|
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-client",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1-alpha.4",
|
|
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.7.
|
|
13
|
+
"@nocobase/server": "0.7.1-alpha.4"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@nocobase/test": "0.7.
|
|
16
|
+
"@nocobase/test": "0.7.1-alpha.4"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "570d039f1904a041729c1967c0637b1109c278a8"
|
|
19
19
|
}
|