@cloudbase/lowcode-builder 1.8.43-alpha.0 → 1.8.44-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.
|
|
3
|
+
"version": "1.8.44-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",
|
|
@@ -419,8 +419,8 @@ 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, subAppId = "", pageId) {
|
|
423
|
+
const cacheKey = subAppId ? `${appId}-${subAppId}-${pageId}` : `${appId}-${pageId}`;
|
|
424
424
|
if (_AUTH_CACHE_MAP[cacheKey] !== undefined) {
|
|
425
425
|
return _AUTH_CACHE_MAP[cacheKey];
|
|
426
426
|
}
|
|
@@ -482,7 +482,19 @@ export async function checkAuth(app, appId, $page) {
|
|
|
482
482
|
return true;
|
|
483
483
|
}
|
|
484
484
|
wx.showNavigationBarLoading();
|
|
485
|
-
|
|
485
|
+
let subAppId = '';
|
|
486
|
+
if ($page.packageName) {
|
|
487
|
+
if ($page.__internal__.subAppId) {
|
|
488
|
+
subAppId = $page.__internal__.subAppId
|
|
489
|
+
} else {
|
|
490
|
+
const matched = $page.packageName.match(/packages\/(.*)$/);
|
|
491
|
+
if (matched?.[1]) {
|
|
492
|
+
subAppId = `sub-${matched[1]}`
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
const requestList = [getAccessPermission(app, appId, subAppId, $page.id)];
|
|
486
498
|
// 暂时先认为有登录页则自定义登录功能开启且生效
|
|
487
499
|
if (loginPage) {
|
|
488
500
|
requestList.push(getAuthConfig(app));
|
|
@@ -541,6 +553,7 @@ export function redirectToLogin(currentPage) {
|
|
|
541
553
|
app.redirectTo({
|
|
542
554
|
pageId: loginPage.id,
|
|
543
555
|
params: {
|
|
556
|
+
packageName: currentPage.packageName || undefined,
|
|
544
557
|
sourcePageId: currentPage.id,
|
|
545
558
|
sourcePageParams: currentPage.params || currentPage.dataset?.params,
|
|
546
559
|
},
|
package/template/mp/page/api.js
CHANGED
|
@@ -2,8 +2,10 @@ 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
|
+
subAppId: '<%= subAppId %>',
|
|
6
7
|
},
|
|
8
|
+
packageName: '<%= packageName %>',
|
|
7
9
|
uuid: '<%= uuid %>',
|
|
8
10
|
label: '<%= label %>',
|
|
9
11
|
|