@gct-paas/core 0.1.1 → 0.1.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.
@@ -13,7 +13,7 @@ function getDefaultExportFromNamespaceIfNotNamed (n) {
13
13
  }
14
14
 
15
15
  function getAugmentedNamespace(n) {
16
- if (n.__esModule) return n;
16
+ if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n;
17
17
  var f = n.default;
18
18
  if (typeof f == "function") {
19
19
  var a = function a () {
@@ -80,9 +80,13 @@ class PluginPgkUtil {
80
80
  if (plugin.imports) {
81
81
  Object.keys(plugin.imports).forEach((key) => {
82
82
  const load = async () => {
83
- const module = await System.import(key);
84
- moduleMap[key] = module;
85
- this.module.set(key, module);
83
+ try {
84
+ const module = await System.import(key);
85
+ moduleMap[key] = module;
86
+ this.module.set(key, module);
87
+ } catch (error) {
88
+ console.error(error);
89
+ }
86
90
  };
87
91
  all.push(load());
88
92
  });
@@ -142,6 +146,10 @@ class PluginPgkUtil {
142
146
  const plugins = config.plugins;
143
147
  plugins.forEach((plugin) => {
144
148
  const module = moduleMap[plugin.key];
149
+ if (!module) {
150
+ console.error(`${plugin.key} \u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u63D2\u4EF6\u914D\u7F6E\u662F\u5426\u6B63\u786E`);
151
+ return;
152
+ }
145
153
  if (platform === Platform.WEB) {
146
154
  const cls = module.web ?? module.default;
147
155
  if (cls) {
@@ -177,6 +185,10 @@ class PluginPgkUtil {
177
185
  const moduleMap = await this.loadPlugins(PluginModeEnum.DESIGN, configs);
178
186
  configs.forEach((plugin) => {
179
187
  const module = moduleMap[plugin.key];
188
+ if (!module) {
189
+ console.error(`${plugin.key} \u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u63D2\u4EF6\u914D\u7F6E\u662F\u5426\u6B63\u786E`);
190
+ return;
191
+ }
180
192
  if (platform === Platform.WEB) {
181
193
  const cls = module.web ?? module.default;
182
194
  if (cls) {
@@ -205,6 +217,10 @@ class PluginPgkUtil {
205
217
  try {
206
218
  const moduleMap = await this.loadPlugins(PluginModeEnum.MOBILE, configs);
207
219
  configs.forEach((plugin) => {
220
+ if (!moduleMap[plugin.key]) {
221
+ console.error(`${plugin.key} \u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u63D2\u4EF6\u914D\u7F6E\u662F\u5426\u6B63\u786E`);
222
+ return;
223
+ }
208
224
  _gct.register.render.mobile.register(
209
225
  plugin.key,
210
226
  moduleMap[plugin.key].default
@@ -226,6 +242,10 @@ class PluginPgkUtil {
226
242
  try {
227
243
  const moduleMap = await this.loadPlugins(PluginModeEnum.WEB, configs);
228
244
  configs.forEach((plugin) => {
245
+ if (!moduleMap[plugin.key]) {
246
+ console.error(`${plugin.key} \u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u63D2\u4EF6\u914D\u7F6E\u662F\u5426\u6B63\u786E`);
247
+ return;
248
+ }
229
249
  _gct.register.render.web.register(
230
250
  plugin.key,
231
251
  moduleMap[plugin.key].default
@@ -26,9 +26,9 @@ function getToken() {
26
26
  }
27
27
  function setToken(token) {
28
28
  if (token) {
29
- setCookie(CoreConst.TOKEN, token, 0, true);
29
+ setCookie(CoreConst.TOKEN, token, 7, true);
30
30
  } else {
31
- clearCookie(CoreConst.TOKEN);
31
+ clearCookie(CoreConst.TOKEN, true);
32
32
  }
33
33
  }
34
34
  function getTenant() {
@@ -36,9 +36,9 @@ function getTenant() {
36
36
  }
37
37
  function setTenant(tenant) {
38
38
  if (tenant) {
39
- setCookie(CoreConst.TENANT, tenant, 0, true);
39
+ setCookie(CoreConst.TENANT, tenant, 7, true);
40
40
  } else {
41
- clearCookie(CoreConst.TENANT);
41
+ clearCookie(CoreConst.TENANT, true);
42
42
  }
43
43
  }
44
44
  function getPathQuery() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/core",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "description": "paas 平台核心包",
6
6
  "main": "dist/index.min.cjs",
@@ -34,6 +34,7 @@
34
34
  "dev": "rollup -c -w --environment=NODE_ENV:development",
35
35
  "build": "npm run lint && rollup -c --environment=NODE_ENV:production && vite build --mode production --config vite.config.ts",
36
36
  "lint": "eslint src/",
37
+ "link2global": "pnpm link --global",
37
38
  "publish:next": "npm run build && npm publish --access public --tag=next --registry=https://registry.npmjs.org/",
38
39
  "publish:dev": "npm run build && npm publish --access public --tag=dev --registry=https://registry.npmjs.org/",
39
40
  "publish:alpha": "npm run build && npm publish --access public --tag=alpha --registry=https://registry.npmjs.org/",
@@ -56,8 +57,8 @@
56
57
  "vue-i18n": "9.6.5"
57
58
  },
58
59
  "devDependencies": {
59
- "@gct-paas/build": "0.1.1",
60
- "@gct-paas/cli": "0.1.1",
60
+ "@gct-paas/build": "0.1.2",
61
+ "@gct-paas/cli": "0.1.2",
61
62
  "@types/path-browserify": "^1.0.3",
62
63
  "@types/qs": "^6.9.18",
63
64
  "fs-extra": "^11.3.0"
@@ -65,5 +66,5 @@
65
66
  "peerDependencies": {
66
67
  "vue": "^3.x"
67
68
  },
68
- "gitHead": "7a166eedf06af8342dfe256c5c57dfe2a304a9bd"
69
+ "gitHead": "d16ad2d01b1f566243002c25c90615ae8a0b36c2"
69
70
  }