@lambo-design/login-form 1.0.0-beta.32 → 1.0.0-beta.36
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 +3 -3
- package/src/login-form.vue +38 -1
- package/src/login-qr.vue +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lambo-design/login-form",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.36",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "lambo",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"registry": "https://registry.npmjs.org/"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@lambo-design/core": "^4.7.1-beta.
|
|
14
|
-
"@lambo-design/shared": "^1.0.0-beta.
|
|
13
|
+
"@lambo-design/core": "^4.7.1-beta.176",
|
|
14
|
+
"@lambo-design/shared": "^1.0.0-beta.357"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"release": "pnpm release-beta && git push --follow-tags && pnpm re-publish",
|
package/src/login-form.vue
CHANGED
|
@@ -51,6 +51,9 @@
|
|
|
51
51
|
<FormItem v-if="captchaMethod === t('login-form.other.captcha-method-slide-image')">
|
|
52
52
|
<Button long :disabled="isDisabled" @click="showSlideVerify">{{ buttonText }}</Button>
|
|
53
53
|
</FormItem>
|
|
54
|
+
<FormItem v-if="captchaMethod === '文字点选' || captchaMethod === '语序点选' || captchaMethod === '旋转验证码'">
|
|
55
|
+
<Button long :disabled="isDisabled" @click="showWordClickVerify">{{ buttonText }}</Button>
|
|
56
|
+
</FormItem>
|
|
54
57
|
<FormItem v-if="captchaMethod === t('login-form.other.captcha-method-message-center') && channelDataList.length > 0 && channelDataList.length !== 1">
|
|
55
58
|
<span class="login-method-label">请选择登录验证方式</span>
|
|
56
59
|
<ButtonGroup style="display: flex;">
|
|
@@ -135,6 +138,7 @@ export default {
|
|
|
135
138
|
templateId:{type: String},
|
|
136
139
|
mailConfigId:{type: String},
|
|
137
140
|
isSlideVerify:{type: Boolean},
|
|
141
|
+
isWordClickVerify:{type: Boolean},
|
|
138
142
|
buttonText: {type:String}, // 初始按钮文本
|
|
139
143
|
isDisabled: {type:Boolean},
|
|
140
144
|
channelDataList:{
|
|
@@ -285,6 +289,34 @@ export default {
|
|
|
285
289
|
this.$Message.error(this.t('login-form.box.form-user-name'));
|
|
286
290
|
}
|
|
287
291
|
},
|
|
292
|
+
showWordClickVerify(){
|
|
293
|
+
if (this.form.userName && this.form.userName.trim().length > 0){
|
|
294
|
+
let params = {
|
|
295
|
+
userName: this.form.userName,
|
|
296
|
+
password: this.form.password,
|
|
297
|
+
validCodeInput: this.form.validCode,
|
|
298
|
+
validCodeId: this.validCodeId
|
|
299
|
+
}
|
|
300
|
+
if (this.pasCryptor) {
|
|
301
|
+
params.pasCryptor = this.pasCryptor;
|
|
302
|
+
params.pasEncode = this.getCryptorPassword(this.form.password,this.form.validCode,this.pasCryptor);
|
|
303
|
+
} else {
|
|
304
|
+
params.pasMd5 = this.getCryptorPassword(this.form.password,this.form.validCode,'md5');
|
|
305
|
+
params.pasSm3 = this.getCryptorPassword(this.form.password,this.form.validCode,'sm3');
|
|
306
|
+
}
|
|
307
|
+
this.$emit('show-word-click-verify', true, params, this.captchaMethod)
|
|
308
|
+
|
|
309
|
+
this.setLocalUserId(this.form.userName)
|
|
310
|
+
if (this.rememberMe == true) {
|
|
311
|
+
this.setLocalStorage(this.form.userName)
|
|
312
|
+
}
|
|
313
|
+
if (this.rememberMe == false) {
|
|
314
|
+
this.clearLocalStorage();
|
|
315
|
+
}
|
|
316
|
+
}else{
|
|
317
|
+
this.$Message.error(this.t('login-form.box.form-user-name'));
|
|
318
|
+
}
|
|
319
|
+
},
|
|
288
320
|
handleSubmit() {
|
|
289
321
|
this.$refs.loginForm.validate((valid) => {
|
|
290
322
|
if (this.captchaMethod === this.t('login-form.other.captcha-method-message-center') && !this.selectedLoginMethod) {
|
|
@@ -295,8 +327,13 @@ export default {
|
|
|
295
327
|
&& !this.isSlideVerify){
|
|
296
328
|
this.$Message.error(this.t('login-form.box.form-rule-click-login'));
|
|
297
329
|
}
|
|
330
|
+
const isWordClickMethod = this.captchaMethod === '文字点选' || this.captchaMethod === '语序点选' || this.captchaMethod === '旋转验证码'
|
|
331
|
+
if(valid && isWordClickMethod && !this.isWordClickVerify){
|
|
332
|
+
this.$Message.error(this.t('login-form.box.form-rule-click-login'));
|
|
333
|
+
}
|
|
298
334
|
if (valid && ((this.captchaMethod == this.t('login-form.other.captcha-method-slide-image')
|
|
299
|
-
&& this.isSlideVerify) ||
|
|
335
|
+
&& this.isSlideVerify) || (isWordClickMethod && this.isWordClickVerify)
|
|
336
|
+
|| (!isWordClickMethod && this.captchaMethod != this.t('login-form.other.captcha-method-slide-image')))) {
|
|
300
337
|
let params = {
|
|
301
338
|
userName: this.form.userName,
|
|
302
339
|
password: this.form.password,
|
package/src/login-qr.vue
CHANGED
|
@@ -58,7 +58,7 @@ export default {
|
|
|
58
58
|
default: false
|
|
59
59
|
},
|
|
60
60
|
qrType:{
|
|
61
|
-
type:
|
|
61
|
+
type: Array,
|
|
62
62
|
default: ['0','1']
|
|
63
63
|
}
|
|
64
64
|
},
|
|
@@ -68,7 +68,7 @@ export default {
|
|
|
68
68
|
ddClientId: '',
|
|
69
69
|
wwLoginInstance: null,
|
|
70
70
|
dingTalkLoginInstance: null,
|
|
71
|
-
currentLoginType: '
|
|
71
|
+
currentLoginType: '',
|
|
72
72
|
LoginConfig: {},
|
|
73
73
|
wxImg,
|
|
74
74
|
ddImg
|
|
@@ -83,6 +83,7 @@ export default {
|
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
mounted() {
|
|
86
|
+
this.currentLoginType = this.qrType.includes('0') ? 'wechat' : 'dingtalk';
|
|
86
87
|
this.initLoginInstance();
|
|
87
88
|
},
|
|
88
89
|
beforeDestroy() {
|