@cloudbase/lowcode-builder 1.9.7 → 1.9.9
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/builder/config/dependencies.js +3 -3
- package/lib/builder/mp/index.js +9 -6
- package/lib/builder/mp/materials.js +1 -1
- package/lib/builder/mp/util.d.ts +1 -1
- package/lib/builder/mp/util.js +5 -3
- package/lib/builder.web.js +2 -2
- package/package.json +2 -2
- package/template/html/index.html.ejs +3 -3
- package/template/mp/app/weapps-api.js +2 -0
- package/template/mp/datasources/config.js.tpl +23 -5
- package/template/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/lowcode-builder",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.9",
|
|
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",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@babel/core": "7.21.4",
|
|
51
51
|
"@babel/preset-env": "7.21.4",
|
|
52
|
-
"@cloudbase/cals": "^1.2.
|
|
52
|
+
"@cloudbase/cals": "^1.2.5",
|
|
53
53
|
"@cloudbase/lowcode-generator": "^1.8.37",
|
|
54
54
|
"axios": "^0.21.0",
|
|
55
55
|
"chalk": "^2.4.2",
|
|
@@ -464,7 +464,7 @@
|
|
|
464
464
|
<script type="module" src="/src/index.jsx"></script>
|
|
465
465
|
<% } %> <% if(!isAdminPortal){ %>
|
|
466
466
|
<script src="<%= wedaPrivateConfigEndpoint ? wedaPrivateConfigEndpoint : '' %>/weda-config/weda-private.js"></script>
|
|
467
|
-
<script src="<%= cdnEndpoints.cloudbase %>/cloudbase-js-sdk/2.8.
|
|
467
|
+
<script src="<%= cdnEndpoints.cloudbase %>/cloudbase-js-sdk/2.8.21-beta.0/cloudbase.full.js?v=1"></script>
|
|
468
468
|
<script
|
|
469
469
|
crossorigin
|
|
470
470
|
src="<%= cdnEndpoints.cdngo %>/lcap/lcap-resource-cdngo/-/release/_npm/cloudbase-adapter-privatelink@0.0.2/dist/index.js"
|
|
@@ -528,7 +528,7 @@
|
|
|
528
528
|
crossorigin="anonymous"
|
|
529
529
|
src="<%=
|
|
530
530
|
cdnEndpoints.cdngo
|
|
531
|
-
%>/lcap/lcap-resource-cdngo/-/release/_npm/@cloudbase/weda-cloud-sdk@1.0.
|
|
531
|
+
%>/lcap/lcap-resource-cdngo/-/release/_npm/@cloudbase/weda-cloud-sdk@1.0.89/dist/h5.browser.js"
|
|
532
532
|
></script>
|
|
533
533
|
<script
|
|
534
534
|
crossorigin
|
|
@@ -557,7 +557,7 @@
|
|
|
557
557
|
crossorigin
|
|
558
558
|
src="<%=
|
|
559
559
|
cdnEndpoints.cdngo
|
|
560
|
-
%>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.
|
|
560
|
+
%>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.be9848557e443dbc9550.bundle.js"
|
|
561
561
|
></script>
|
|
562
562
|
</body>
|
|
563
563
|
</html>
|
|
@@ -8,6 +8,7 @@ import { default as cloudConfig } from '<%= subLevelPath %>../datasources/config
|
|
|
8
8
|
import { createDataset } from '<%= subLevelPath %>../common/cloud-sdk'
|
|
9
9
|
|
|
10
10
|
import config from '<%= subLevelPath %>../common/config';
|
|
11
|
+
import { LOGIN_CONFIG } from '../common/util'
|
|
11
12
|
|
|
12
13
|
<%= importor.state? `import state from '../lowcode/state'` : "const state = {}" %>
|
|
13
14
|
<%= importor.computed? `import computed from '../lowcode/computed'` : "const computed = {}" %>
|
|
@@ -86,6 +87,7 @@ function createGlboalApi() {
|
|
|
86
87
|
staticResourceDomain: config.domain,
|
|
87
88
|
privatelink: cloudConfig.privatelink,
|
|
88
89
|
envVersion: cloudConfig.isProd ? 'production' : 'preview',
|
|
90
|
+
accessType: LOGIN_CONFIG?.access?.type, // 登录模式,'default'(无需登录) | 'env'(托管登录) | 'hash'(独立登录) | 'self'(自定义登录)
|
|
89
91
|
...(<%= appConfig %>)
|
|
90
92
|
},
|
|
91
93
|
});
|
|
@@ -49,11 +49,29 @@ const CLOUD_CONFIG = {
|
|
|
49
49
|
})
|
|
50
50
|
},
|
|
51
51
|
__defaultLoginType__: '<%= defaultLoginType %>',
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
customConfig: {
|
|
53
|
+
async login({ app, auth, loginState, defaultLogin }) {
|
|
54
|
+
if (!LOGIN_CONFIG?.access?.needLogin) {
|
|
55
|
+
if (<%= pureAnonymousLogin %>) {
|
|
56
|
+
return !loginState.isAnonymous && await auth.signInAnonymously();
|
|
57
|
+
} else if (!config.endpointType) {
|
|
58
|
+
return await auth.signInAnonymouslyInWx();
|
|
59
|
+
}
|
|
60
|
+
} else if (<%= publicPage %>){
|
|
61
|
+
const pages = getCurrentPages();
|
|
62
|
+
const currentPage = pages[pages.length - 1]?.route?.match(/^pages\/(.*)\//)?.[1] || getApp().app?.__internal__?.getConfig()?.page?.[0]?.id;
|
|
63
|
+
if (<%= publicPage %>.includes(currentPage)) {
|
|
64
|
+
// 未登录时,进入公开访问页面,则匿名登录
|
|
65
|
+
return !loginState.isAnonymous && await auth.signInAnonymously();
|
|
66
|
+
} else {
|
|
67
|
+
const { redirectToLogin } = getApp().app?.auth?.__internal__ || {};
|
|
68
|
+
return redirectToLogin?.();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return await defaultLogin();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
57
75
|
}
|
|
58
76
|
|
|
59
77
|
export default CLOUD_CONFIG
|
package/template/package.json
CHANGED