@cloudbase/lowcode-builder 0.1.8 → 0.1.11
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/index.js +1 -5
- package/lib/builder/h5/copy.js +1 -5
- package/lib/builder/h5/material.js +1 -5
- package/lib/builder/mp/index.js +19 -7
- package/lib/builder/mp/materials.js +1 -5
- package/lib/builder/mp/mixMode.js +1 -5
- package/lib/builder/mp/mp_config.js +3 -7
- package/lib/builder/mp/plugin.js +1 -5
- package/lib/builder/util/generateFiles.js +1 -5
- package/lib/builder/util/index.js +1 -5
- package/lib/builder/util/mp.js +1 -5
- package/lib/builder/util/net.js +1 -5
- package/lib/index.js +1 -5
- package/package.json +7 -5
- package/template/mp/app/weapps-api.js +6 -5
- package/template/mp/app.js +58 -1
- package/template/mp/common/jwt.js +106 -0
- package/template/mp/common/util.js +119 -16
- package/template/mp/common/weapp-page.js +6 -6
- package/template/mp/datasources/config.js.tpl +2 -0
- package/template/mp/datasources/index.js +6 -3
- package/template/mp/package.json +3 -2
- package/template/package.json +3 -3
- package/template/src/app/global-api.js +1 -1
- package/template/src/datasources/config.js.tpl +2 -0
- package/template/src/datasources/index.js +6 -3
- package/lib/builder.web.js +0 -79
|
@@ -23,9 +23,9 @@ export function createPage(
|
|
|
23
23
|
const evtHandlers = createEventHandlers(evtListeners, context);
|
|
24
24
|
|
|
25
25
|
function extractLifecyles() {
|
|
26
|
-
const result = {
|
|
27
|
-
Object.keys(lifecycle).map(name=>{
|
|
28
|
-
result[name] = function() {
|
|
26
|
+
const result = {};
|
|
27
|
+
Object.keys(lifecycle).map(name => {
|
|
28
|
+
result[name] = function () {
|
|
29
29
|
return lifecycle[name].apply(this.getWeAppInst(), arguments)
|
|
30
30
|
}
|
|
31
31
|
})
|
|
@@ -73,7 +73,7 @@ export function createPage(
|
|
|
73
73
|
onLoad(options) {
|
|
74
74
|
const $page = this.getWeAppInst()
|
|
75
75
|
setConfig({ currentPageId: $page.uuid });
|
|
76
|
-
app.activePage = $page;
|
|
76
|
+
app.__internal__.activePage = $page;
|
|
77
77
|
this._pageActive = true;
|
|
78
78
|
|
|
79
79
|
let query = decodePageQuery(options || {});
|
|
@@ -100,14 +100,14 @@ export function createPage(
|
|
|
100
100
|
async onShow() {
|
|
101
101
|
const $page = this.getWeAppInst()
|
|
102
102
|
setConfig({ currentPageId: $page.uuid });
|
|
103
|
-
app.activePage = $page;
|
|
103
|
+
app.__internal__.activePage = $page;
|
|
104
104
|
this._pageActive = true;
|
|
105
105
|
|
|
106
106
|
const hook = lifecycle.onShow || lifecycle.onPageShow;
|
|
107
107
|
hook && hook.call($page);
|
|
108
108
|
|
|
109
109
|
// 权限检查
|
|
110
|
-
if (await checkAuth(app, app.id,
|
|
110
|
+
if (await checkAuth(app, app.id, $page)) {
|
|
111
111
|
this.setData({
|
|
112
112
|
weDaHasLogin: true,
|
|
113
113
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WEDA_CLOUD_SDK } from '@cloudbase/weda-client'
|
|
1
|
+
import { _WEDA_CLOUD_SDK as WEDA_CLOUD_SDK } from '@cloudbase/weda-client'
|
|
2
2
|
const {
|
|
3
3
|
setConfig,
|
|
4
4
|
initTcb,
|
|
@@ -8,7 +8,8 @@ const {
|
|
|
8
8
|
generateParamsParser,
|
|
9
9
|
EXTRA_API,
|
|
10
10
|
DS_API,
|
|
11
|
-
DS_SDK
|
|
11
|
+
DS_SDK,
|
|
12
|
+
getAccessToken,
|
|
12
13
|
} = WEDA_CLOUD_SDK
|
|
13
14
|
|
|
14
15
|
export {
|
|
@@ -19,7 +20,9 @@ export {
|
|
|
19
20
|
CLOUD_SDK,
|
|
20
21
|
DS_API,
|
|
21
22
|
DS_SDK,
|
|
22
|
-
setConfig
|
|
23
|
+
setConfig,
|
|
24
|
+
getAccessToken,
|
|
25
|
+
initTcb,
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
import config from './config'
|
package/template/mp/package.json
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
"version": "1.0.8",
|
|
4
4
|
"scripts": {},
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@cloudbase/weda-client": "
|
|
6
|
+
"@cloudbase/weda-client": "0.2.0",
|
|
7
|
+
"@cloudbase/oauth": "0.1.1-alpha.2",
|
|
7
8
|
"mobx": "^5.15.4",
|
|
8
9
|
"lodash.get": "^4.4.2",
|
|
9
10
|
"lodash.set": "^4.3.2",
|
|
@@ -13,4 +14,4 @@
|
|
|
13
14
|
})
|
|
14
15
|
%>
|
|
15
16
|
}
|
|
16
|
-
}
|
|
17
|
+
}
|
package/template/package.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"build-web": "rm -rf ./preivew && webpack --config ./webpack/webpack.web.prod.js"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@cloudbase/js-sdk": "
|
|
8
|
+
"@cloudbase/js-sdk": "2.4.0-beta.0",
|
|
9
9
|
"@tcwd/weapps-core": "2.2.6",
|
|
10
10
|
"@tcwd/weapps-sdk": "1.2.9",
|
|
11
11
|
"@zxing/library": "^0.18.6",
|
|
12
|
-
"@cloudbase/weda-client": "
|
|
12
|
+
"@cloudbase/weda-client": "0.2.0",
|
|
13
13
|
"fastclick": "^1.0.6",
|
|
14
14
|
"lodash": "^4.17.19",
|
|
15
15
|
"mobx": "^5.15.4",
|
|
@@ -60,4 +60,4 @@
|
|
|
60
60
|
"webpack-cli": "^4.2.0",
|
|
61
61
|
"webpack-dev-server": "^3.11.0"
|
|
62
62
|
}
|
|
63
|
-
}
|
|
63
|
+
}
|
|
@@ -7,7 +7,7 @@ import { formatDate } from '../utils/date';
|
|
|
7
7
|
import { getter, setter, _isMobile } from '../utils';
|
|
8
8
|
import actionMap from './material-actions';
|
|
9
9
|
import { scanCodeApi } from '../utils/scan-code-action';
|
|
10
|
-
import { createWebApp, ACTIONS_KEY, ROUTER_KEY } from '@cloudbase/weda-client';
|
|
10
|
+
import { createWebApp, _ACTIONS_KEY as ACTIONS_KEY, _ROUTER_KEY as ROUTER_KEY } from '@cloudbase/weda-client';
|
|
11
11
|
import { createDataset, EXTRA_API } from '../datasources/index'
|
|
12
12
|
|
|
13
13
|
const mainAppKey = '__weappsMainApp';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WEDA_CLOUD_SDK } from '@cloudbase/weda-client'
|
|
1
|
+
import { _WEDA_CLOUD_SDK as WEDA_CLOUD_SDK } from '@cloudbase/weda-client'
|
|
2
2
|
import config from './config';
|
|
3
3
|
|
|
4
4
|
const {
|
|
@@ -10,7 +10,8 @@ const {
|
|
|
10
10
|
generateParamsParser,
|
|
11
11
|
EXTRA_API,
|
|
12
12
|
DS_API,
|
|
13
|
-
DS_SDK
|
|
13
|
+
DS_SDK,
|
|
14
|
+
getAccessToken,
|
|
14
15
|
} = WEDA_CLOUD_SDK
|
|
15
16
|
|
|
16
17
|
export {
|
|
@@ -21,7 +22,9 @@ export {
|
|
|
21
22
|
CLOUD_SDK,
|
|
22
23
|
DS_API,
|
|
23
24
|
DS_SDK,
|
|
24
|
-
setConfig
|
|
25
|
+
setConfig,
|
|
26
|
+
initTcb,
|
|
27
|
+
getAccessToken,
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
setConfig(config);
|