@cloudbase/lowcode-builder 1.9.13 → 1.10.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.
- package/lib/builder/config/dependencies.js +3 -3
- package/lib/builder/core/index.js +8 -3
- package/lib/builder/h5/generate.js +1 -6
- package/lib/builder/mp/util.js +10 -4
- package/lib/builder/mp/wxml.js +10 -1
- package/lib/builder.web.js +7 -7
- package/package.json +2 -2
- package/template/html/index.html.ejs +4 -4
- package/template/mp/common/info/index.json +3 -2
- package/template/mp/common/util.js +34 -16
- package/template/mp/datasources/config.js.tpl +1 -1
- package/template/mp/packages/$wd_system/pages/login/index.js +544 -279
- package/template/mp/packages/$wd_system/pages/login/index.wxml +89 -61
- package/template/mp/packages/$wd_system/pages/login/index.wxss +82 -22
- package/template/mp/packages/$wd_system/pages/login/methods/loginByOpenId.js +24 -0
- package/template/mp/packages/$wd_system/pages/login/methods/loginByUnionId.js +24 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateSystemPackageDependencies = exports.generateLibDependencies = exports.generatePackageDependencies = void 0;
|
|
4
4
|
const cals_1 = require("@cloudbase/cals");
|
|
5
|
-
const CLOUDBASE_VERSION = '2.8.
|
|
5
|
+
const CLOUDBASE_VERSION = '2.8.34';
|
|
6
6
|
const BASE_DEPS = {
|
|
7
7
|
'miniprogram-gesture': '^1.0.6',
|
|
8
8
|
mobx: '^5',
|
|
@@ -13,8 +13,8 @@ const BASE_DEPS = {
|
|
|
13
13
|
* 注意锁版本
|
|
14
14
|
*/
|
|
15
15
|
const CLOUDBASE_DEPS = {
|
|
16
|
-
'@cloudbase/weda-client': '1.1.
|
|
17
|
-
'@cloudbase/weda-cloud-sdk': '1.0.
|
|
16
|
+
'@cloudbase/weda-client': '1.1.16',
|
|
17
|
+
'@cloudbase/weda-cloud-sdk': '1.0.96',
|
|
18
18
|
};
|
|
19
19
|
const COMPONENT_DEPS = {
|
|
20
20
|
'@cloudbase/lowcode-render': '^1.1.7',
|
|
@@ -99,9 +99,14 @@ async function buildWedaApp({ cals, subAppCalsList: _subAppCalsList = [], depend
|
|
|
99
99
|
let appBuildDir = (output === null || output === void 0 ? void 0 : output.path) || (runtime === types_1.RUNTIME.CI ? (_a = (0, util_1.getCompileDirs)('app')) === null || _a === void 0 ? void 0 : _a.appBuildDir : (_b = (0, util_1.getCompileDirs)(appKey)) === null || _b === void 0 ? void 0 : _b.appBuildDir);
|
|
100
100
|
let runtimeDynamicConfig = {};
|
|
101
101
|
if (enableExpiredTag) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
try {
|
|
103
|
+
const { data } = await axios_1.default.get(config_1.RUNTIME_CONFIG_URL, { responseType: 'json' });
|
|
104
|
+
if (data) {
|
|
105
|
+
runtimeDynamicConfig = data;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
catch (e) {
|
|
109
|
+
console.log('get runtime config error', e);
|
|
105
110
|
}
|
|
106
111
|
}
|
|
107
112
|
const officialLib = dependencies.find((item) => item.name === cals_1.OFFICIAL_LIB_KEY);
|
|
@@ -101,12 +101,7 @@ enableLoading = undefined, publicPath = '/', }) {
|
|
|
101
101
|
* 当应用数据补充完成后可以祛除
|
|
102
102
|
*/
|
|
103
103
|
enableLoading: !(0, common_2.buildAsAdminPortalByBuildType)(buildTypeList) && enableLoading === undefined
|
|
104
|
-
? [
|
|
105
|
-
'lowcode-4gzdsu5k66946492',
|
|
106
|
-
'lowcode-2gay8jgh25c7b1cf',
|
|
107
|
-
'lowcode-4g9b78bx94404d85',
|
|
108
|
-
'lowcode-8gmx7bat3135e2de',
|
|
109
|
-
].includes(envId)
|
|
104
|
+
? ['lowcode-4g9b78bx94404d85'].includes(envId)
|
|
110
105
|
: enableLoading,
|
|
111
106
|
}));
|
|
112
107
|
}
|
package/lib/builder/mp/util.js
CHANGED
|
@@ -253,7 +253,7 @@ function getListenersHandlers(ctx, listeners = [], id, componentApi) {
|
|
|
253
253
|
const { enableAsyncMaterials = false } = ctx;
|
|
254
254
|
const eventHandlers = {};
|
|
255
255
|
listeners.forEach((l) => {
|
|
256
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
256
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
257
257
|
const handlerName = (0, wxml_1.getMpEventHandlerName)(id, l.trigger, l);
|
|
258
258
|
const sourceKey = `${((_a = l.handler) === null || _a === void 0 ? void 0 : _a.moduleName) || ''}:${((_b = l.handler) === null || _b === void 0 ? void 0 : _b.name) || ''}`;
|
|
259
259
|
eventHandlers[handlerName] = eventHandlers[handlerName] || [];
|
|
@@ -287,8 +287,14 @@ function getListenersHandlers(ctx, listeners = [], id, componentApi) {
|
|
|
287
287
|
handler = `function({data}) { return $app.utils.getCurrentPage().setParams(data.params);}`;
|
|
288
288
|
break;
|
|
289
289
|
}
|
|
290
|
+
case `${weapps_core_1.ActionType.Platform}:ai.LLM.chat`:
|
|
291
|
+
case `${weapps_core_1.ActionType.Platform}:ai.bot.sendMessage`:
|
|
292
|
+
case `${weapps_core_1.ActionType.Platform}:ai.bot.getRecommendQuestions`: {
|
|
293
|
+
handler = `function({data, $w}) { return $app.${(_c = l.handler) === null || _c === void 0 ? void 0 : _c.name}(data, $w);}`;
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
290
296
|
default: {
|
|
291
|
-
handler = `function({args}){ return $app.${(
|
|
297
|
+
handler = `function({args}){ return $app.${(_d = l.handler) === null || _d === void 0 ? void 0 : _d.name}(...args)}`;
|
|
292
298
|
break;
|
|
293
299
|
}
|
|
294
300
|
}
|
|
@@ -299,7 +305,7 @@ function getListenersHandlers(ctx, listeners = [], id, componentApi) {
|
|
|
299
305
|
break;
|
|
300
306
|
}
|
|
301
307
|
case weapps_core_1.ActionType.PropEvent: {
|
|
302
|
-
handler = `function({event, data = {}}){ return ${componentApi}.props.events.${(
|
|
308
|
+
handler = `function({event, data = {}}){ return ${componentApi}.props.events.${(_e = l.handler) === null || _e === void 0 ? void 0 : _e.name}({...event.detail, ...data}) }`;
|
|
303
309
|
break;
|
|
304
310
|
}
|
|
305
311
|
case weapps_core_1.ActionType.Rematch: {
|
|
@@ -307,7 +313,7 @@ function getListenersHandlers(ctx, listeners = [], id, componentApi) {
|
|
|
307
313
|
break;
|
|
308
314
|
}
|
|
309
315
|
case weapps_core_1.ActionType.GeneralFunc: {
|
|
310
|
-
handler = `function({event, $w, params}) { return (\n${((
|
|
316
|
+
handler = `function({event, $w, params}) { return (\n${((_h = (_g = (_f = l.handler) === null || _f === void 0 ? void 0 : _f.code) === null || _g === void 0 ? void 0 : _g.replace) === null || _h === void 0 ? void 0 : _h.call(_g, /;\s*$/, '')) || '()=>{}'}\n)({event}) }`;
|
|
311
317
|
break;
|
|
312
318
|
}
|
|
313
319
|
}
|
package/lib/builder/mp/wxml.js
CHANGED
|
@@ -146,11 +146,20 @@ function generateWxml(ctx, widgets, docTag, wxmlDataPrefix, usingComponents, com
|
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
if (ctx.enableLoading) {
|
|
149
|
+
let loadingTag = WD_INFO;
|
|
150
|
+
if (typeof ctx.enableLoading !== 'boolean') {
|
|
151
|
+
const meta = (0, materials_1.getWxmlTag)(ctx, { moduleName: '$template', name: ctx.enableLoading }, nameMangler, mode);
|
|
152
|
+
if (meta.path) {
|
|
153
|
+
loadingTag = 'wd-custom-loading-tag';
|
|
154
|
+
usingComponents[loadingTag] = meta.path;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
149
157
|
pageMeta.elements.push({
|
|
150
158
|
type: 'element',
|
|
151
|
-
name:
|
|
159
|
+
name: loadingTag,
|
|
152
160
|
attributes: {
|
|
153
161
|
['wx:if']: '{{_isCheckingAtuh && !_expiredMessage}}',
|
|
162
|
+
pageUUID: ctx.pageUUID,
|
|
154
163
|
type: 'loading',
|
|
155
164
|
},
|
|
156
165
|
elements: [],
|