@nocobase/plugin-license 2.1.0-alpha.1 → 2.1.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.
@@ -9,16 +9,16 @@
9
9
 
10
10
  module.exports = {
11
11
  "react": "18.2.0",
12
- "@nocobase/client": "2.1.0-alpha.1",
12
+ "@nocobase/client": "2.1.0-beta.1",
13
13
  "antd": "5.24.2",
14
14
  "ahooks": "3.7.8",
15
15
  "@ant-design/icons": "5.6.1",
16
16
  "@formily/react": "2.3.7",
17
- "@nocobase/license-kit": "0.3.5",
17
+ "@nocobase/license-kit": "0.3.7",
18
18
  "react-i18next": "11.18.6",
19
- "@nocobase/server": "2.1.0-alpha.1",
19
+ "@nocobase/server": "2.1.0-beta.1",
20
20
  "lodash": "4.17.21",
21
21
  "koa": "2.16.0",
22
22
  "axios": "1.7.7",
23
- "@nocobase/logger": "2.1.0-alpha.1"
23
+ "@nocobase/logger": "2.1.0-beta.1"
24
24
  };
@@ -92,7 +92,8 @@ async function saveLicenseKey(licenseKey, ctx) {
92
92
  const filePath = import_path.default.resolve(dir, "license-key");
93
93
  await import_fs.default.promises.writeFile(filePath, licenseKey);
94
94
  if (ctx && ctx.cache) {
95
- await ctx.cache.set("license-key", licenseKey);
95
+ await ctx.cache.del(import_interface2.CACHE_KEY);
96
+ await ctx.cache.set(import_interface2.CACHE_KEY, licenseKey, 30 * 24 * 60 * 60 * 1e3);
96
97
  }
97
98
  }
98
99
  async function getLocalKeyData() {
@@ -111,6 +112,9 @@ async function getKey(ctx) {
111
112
  if (ctx == null ? void 0 : ctx.cache) {
112
113
  try {
113
114
  key = await ctx.cache.get(import_interface2.CACHE_KEY);
115
+ if (key) {
116
+ return key;
117
+ }
114
118
  } catch (e) {
115
119
  import_logger.logger.warn("Failed to get license key from cache", e);
116
120
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-license",
3
- "version": "2.1.0-alpha.1",
3
+ "version": "2.1.0-beta.1",
4
4
  "main": "dist/server/index.js",
5
5
  "displayName": "License settings",
6
6
  "displayName.ru-RU": "Настройки лицензии",
@@ -16,5 +16,5 @@
16
16
  "scripts": {
17
17
  "ts:env": "tsc -p tsconfig.env.json"
18
18
  },
19
- "gitHead": "d27baf21569643d6fa83f882233f4e90eb5b89f1"
19
+ "gitHead": "de3efeb357b6a98b813f1c14831afa832aed1780"
20
20
  }