@cloudbase/lowcode-builder 1.10.29 → 1.10.31
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 +2 -2
- package/lib/builder.web.js +2 -2
- package/package.json +2 -2
- package/template/html/index.html.ejs +2 -2
- package/template/mp/packages/$wd_system/pages/login/index.js +9 -8
- package/template/mp/packages/$wd_system/pages/login/methods/contants.js +0 -1
- package/template/mp/packages/$wd_system/pages/login/methods/loginByEmail.js +7 -3
- package/template/mp/packages/$wd_system/pages/login/methods/loginBySms.js +10 -6
- package/template/webpack/web.prod.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/lowcode-builder",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.31",
|
|
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.20",
|
|
53
53
|
"@cloudbase/lowcode-generator": "^1.8.42",
|
|
54
54
|
"axios": "^0.21.0",
|
|
55
55
|
"chalk": "^2.4.2",
|
|
@@ -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.108/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.75837ebefb01a0b87b0d.bundle.js"
|
|
561
561
|
></script>
|
|
562
562
|
</body>
|
|
563
563
|
</html>
|
|
@@ -316,7 +316,7 @@ Component({
|
|
|
316
316
|
verificationInfo,
|
|
317
317
|
loginOnly: !this.data.settingData.userRegistry?.enable,
|
|
318
318
|
isRegister: this.data.isRegister,
|
|
319
|
-
hasRegisterConfig: this.data.userRegistry?.enable && this.data.userRegistry?.
|
|
319
|
+
hasRegisterConfig: this.data.settingData.userRegistry?.enable && !!this.data.settingData.userRegistry?.miniprogram?.find(v => v.id === this.data.currentLoginType), // 有注册配置,才会走注册配置的判断
|
|
320
320
|
callback: (err, data) => {
|
|
321
321
|
if (err) {
|
|
322
322
|
// 错误处理:更新尝试次数
|
|
@@ -609,6 +609,14 @@ Component({
|
|
|
609
609
|
loginSuccessCallBack(this);
|
|
610
610
|
},
|
|
611
611
|
methodClick(e) {
|
|
612
|
+
if (this.data.disableLoginSubmit) {
|
|
613
|
+
wx.showToast({
|
|
614
|
+
title: '请先阅读并同意协议',
|
|
615
|
+
icon: 'none'
|
|
616
|
+
})
|
|
617
|
+
return;
|
|
618
|
+
};
|
|
619
|
+
|
|
612
620
|
const {
|
|
613
621
|
id
|
|
614
622
|
} = e.currentTarget.dataset.item || {};
|
|
@@ -620,13 +628,6 @@ Component({
|
|
|
620
628
|
})
|
|
621
629
|
|
|
622
630
|
if (AUTO_LOGIN_TYPE.includes(currentLoginType)) {
|
|
623
|
-
if (this.data.disableLoginSubmit) {
|
|
624
|
-
wx.showToast({
|
|
625
|
-
title: '请先阅读并同意协议',
|
|
626
|
-
icon: 'none'
|
|
627
|
-
})
|
|
628
|
-
return;
|
|
629
|
-
};
|
|
630
631
|
this.dealOpenIdOrUnionIdLogin(currentLoginType)
|
|
631
632
|
return;
|
|
632
633
|
}
|
|
@@ -4,4 +4,3 @@ export const emailVerifyInfoKey = 'sso_email_verifyInfo'; // 获取邮箱信息
|
|
|
4
4
|
export const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
5
5
|
export const verifyCodeFailedLimit = 8; // 同一个验证码使用8次即提示错误
|
|
6
6
|
export const verifyDelay = 60; // 获取验证码倒计时,单位s
|
|
7
|
-
export const loginOnly = false;
|
|
@@ -39,8 +39,12 @@ export default async function loginByEmail(
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
if (isRegister && verificationInfo.isUser
|
|
43
|
-
throw
|
|
42
|
+
if (isRegister && verificationInfo.isUser) {
|
|
43
|
+
throw new Error('user has already registered, please log in directly');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (!isRegister && !verificationInfo.isUser) {
|
|
47
|
+
throw { error: 'user not registered, please register first' };
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
// 校验
|
|
@@ -63,7 +67,7 @@ export default async function loginByEmail(
|
|
|
63
67
|
provider_token: bindInfo.providerToken,
|
|
64
68
|
});
|
|
65
69
|
}
|
|
66
|
-
} else if (
|
|
70
|
+
} else if (hasRegisterConfig && isRegister) {
|
|
67
71
|
// 3. 注册
|
|
68
72
|
await auth.signUp({
|
|
69
73
|
email,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { parseSmsLoginError } from './errorHandler';
|
|
2
2
|
import { app } from '../../../../../app/weapps-api';
|
|
3
3
|
import loginSuccessCallBack from './loginSuccessCallBack';
|
|
4
|
-
import { phoneVerifyInfoKey, verifyCodeFailedLimit
|
|
4
|
+
import { phoneVerifyInfoKey, verifyCodeFailedLimit } from './contants';
|
|
5
5
|
|
|
6
6
|
export default async function loginBySms(
|
|
7
7
|
instance,
|
|
8
|
-
{ callback, verificationInfo, verificationCode, phoneNum, bindInfo, isRegister, hasRegisterConfig },
|
|
8
|
+
{ callback, verificationInfo, verificationCode, phoneNum, bindInfo, loginOnly, isRegister, hasRegisterConfig },
|
|
9
9
|
) {
|
|
10
10
|
wx.showLoading({ mask: true });
|
|
11
11
|
const { usedCount = 0 } = wx.getStorageSync(phoneVerifyInfoKey) || {};
|
|
@@ -18,8 +18,12 @@ export default async function loginBySms(
|
|
|
18
18
|
throw { error: 'get_verify_code' };
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
if (isRegister && verificationInfo.isUser
|
|
22
|
-
throw
|
|
21
|
+
if (isRegister && verificationInfo.isUser) {
|
|
22
|
+
throw new Error('user has already registered, please log in directly');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (!isRegister && !verificationInfo.isUser) {
|
|
26
|
+
throw { error: 'user not registered, please register first' };
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
// 校验
|
|
@@ -44,7 +48,7 @@ export default async function loginBySms(
|
|
|
44
48
|
provider_token: bindInfo.providerToken,
|
|
45
49
|
});
|
|
46
50
|
}
|
|
47
|
-
} else if (
|
|
51
|
+
} else if (hasRegisterConfig && isRegister) {
|
|
48
52
|
// 自定义应用走signUp逻辑
|
|
49
53
|
await auth.signUp({
|
|
50
54
|
phone_number: `+86 ${phoneNum}`,
|
|
@@ -60,7 +64,7 @@ export default async function loginBySms(
|
|
|
60
64
|
} catch (e) {
|
|
61
65
|
wx.hideLoading();
|
|
62
66
|
wx.showModal({
|
|
63
|
-
title: '
|
|
67
|
+
title: `验证码${isRegister ? '注册' : '登录'}失败`,
|
|
64
68
|
content: parseSmsLoginError(e),
|
|
65
69
|
});
|
|
66
70
|
callback?.(new Error(parseSmsLoginError(e)));
|
|
@@ -100,7 +100,7 @@ module.exports = function (options) {
|
|
|
100
100
|
}),
|
|
101
101
|
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
|
|
102
102
|
new webpack.NormalModuleReplacementPlugin(
|
|
103
|
-
/@\/components\/(?!ui)(.*)|^@\/(lib|hooks|configs)|^@\/components$/, // 使用否定前瞻匹配除ui外的所有路径
|
|
103
|
+
/@\/components\/(?!ui)(.*)|^@\/(lib|hooks|configs|utils)|^@\/components$/, // 使用否定前瞻匹配除ui外的所有路径
|
|
104
104
|
function (resource) {
|
|
105
105
|
if (/lowcode\//.test(resource.context)) {
|
|
106
106
|
if (resource.request === '@/components') {
|