@cloudbase/lowcode-builder 1.8.44 → 1.8.45-alpha.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/lowcode-builder",
3
- "version": "1.8.44",
3
+ "version": "1.8.45-alpha.0",
4
4
  "description": "云开发 Tencent CloudBase Framework Low Code Plugin,将低码配置生成完整项目并一键部署云开发资源。",
5
5
  "author": "yhsunshining@gmail.com",
6
6
  "homepage": "https://github.com/TencentCloudBase/cloudbase-framework#readme",
@@ -33,7 +33,8 @@
33
33
  "dev:web:serve": "rm -rf dist && node ./webpack/scripts/web.pre.js && cross-env NODE_ENV=development webpack-dev-server --config ./webpack/web.config.js",
34
34
  "dev:web": "rm -rf dist && node ./webpack/scripts/web.pre.js && cross-env NODE_ENV=development webpack --config ./webpack/web.config.js && node ./webpack/scripts/web.post.js",
35
35
  "build:web": "rm -rf dist && node ./webpack/scripts/web.pre.js && cross-env NODE_ENV=production webpack --config ./webpack/web.config.js && node ./webpack/scripts/web.post.js",
36
- "build:template": "./scripts/buildTemplate.sh"
36
+ "build:template": "./scripts/buildTemplate.sh",
37
+ "publish:web": "node ./scripts/publish.ide.js"
37
38
  },
38
39
  "bugs": {
39
40
  "url": "https://github.com/TencentCloudBase/cloudbase-framework/issues"
@@ -41,7 +42,7 @@
41
42
  "dependencies": {
42
43
  "@babel/core": "7.21.4",
43
44
  "@babel/preset-env": "7.21.4",
44
- "@cloudbase/cals": "^1.0.29",
45
+ "@cloudbase/cals": "^1.0.32",
45
46
  "@cloudbase/lowcode-generator": "^1.8.14",
46
47
  "axios": "^0.21.0",
47
48
  "browserfs": "^1.4.3",
@@ -419,8 +419,15 @@ export async function getAuthConfig() {
419
419
 
420
420
  let _AUTH_CACHE_MAP = {};
421
421
 
422
- async function getAccessPermission(app, appId, pageId) {
423
- const cacheKey = `${appId}-${pageId}`;
422
+ async function getAccessPermission(app, appId, packageName = "", pageId) {
423
+ let cacheKey = `${appId}-${pageId}`;
424
+ if (packageName) {
425
+ const matched = packageName.match(/packages\/(.*)$/);
426
+ if (matched?.[1]) {
427
+ cacheKey = `${appId}-${matched?.[1]}-${pageId}`
428
+ }
429
+ }
430
+
424
431
  if (_AUTH_CACHE_MAP[cacheKey] !== undefined) {
425
432
  return _AUTH_CACHE_MAP[cacheKey];
426
433
  }
@@ -482,7 +489,7 @@ export async function checkAuth(app, appId, $page) {
482
489
  return true;
483
490
  }
484
491
  wx.showNavigationBarLoading();
485
- const requestList = [getAccessPermission(app, appId, $page.id)];
492
+ const requestList = [getAccessPermission(app, appId, $page.packageName, $page.id)];
486
493
  // 暂时先认为有登录页则自定义登录功能开启且生效
487
494
  if (loginPage) {
488
495
  requestList.push(getAuthConfig(app));
@@ -541,6 +548,7 @@ export function redirectToLogin(currentPage) {
541
548
  app.redirectTo({
542
549
  pageId: loginPage.id,
543
550
  params: {
551
+ packageName: currentPage.packageName || undefined,
544
552
  sourcePageId: currentPage.id,
545
553
  sourcePageParams: currentPage.params || currentPage.dataset?.params,
546
554
  },
@@ -2,8 +2,9 @@ import { $w as baseAPI } from '<%= subLevelPath %>../../app/weapps-api'
2
2
 
3
3
  export const $page = {
4
4
  __internal__: {
5
- active: false
5
+ active: false,
6
6
  },
7
+ packageName: '<%= packageName %>',
7
8
  uuid: '<%= uuid %>',
8
9
  label: '<%= label %>',
9
10