Skip to content

Commit 0f039f1

Browse files
committed
implemented lock screen login and fixed login proble
1 parent a828cd8 commit 0f039f1

File tree

4 files changed

+45
-18
lines changed

4 files changed

+45
-18
lines changed

Vue/src/views/login.vue

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -143,22 +143,26 @@ export default {
143143
async handleSubmit () {
144144
this.$refs.loginForm.validate(async (valid) => {
145145
if (valid) {
146-
let self = this;
147146
this.$Message.loading({
148147
content: this.L('PleaseWait'),
149148
duration:0
150149
});
151150
152-
await this.$store.dispatch('user/login', this.form)
153-
.then(response => {
154-
location.reload();
155-
}, (error) => {
156-
this.$Modal.error({
157-
title:'',
158-
content: 'Login failed !'
159-
});
160-
this.$Message.destroy();
161-
});
151+
let self = this;
152+
153+
await this.$store.dispatch({
154+
type: 'user/login',
155+
data: self.form
156+
}).then(response => {
157+
Cookies.set('userNameOrEmailAddress', self.form.userNameOrEmailAddress);
158+
location.reload();
159+
}, (error) => {
160+
this.$Modal.error({
161+
title:'',
162+
content: 'Login failed !'
163+
});
164+
this.$Message.destroy();
165+
});
162166
}
163167
});
164168
}

Vue/src/views/main-components/lockscreen/components/unlock.vue

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,35 @@ export default {
5050
}
5151
},
5252
methods: {
53-
validator () {
54-
return true; // 你可以在这里写密码验证方式,如发起ajax请求将用户输入的密码this.password与数据库用户密码对比
53+
async validator () {
54+
var username = Cookies.get('userNameOrEmailAddress');
55+
if(!username){
56+
return false;
57+
}
58+
59+
var password = this.password;
60+
var result = false;
61+
await this.$store.dispatch({
62+
type: 'user/login',
63+
data: {
64+
userNameOrEmailAddress: username,
65+
password: password
66+
}
67+
}).then(response => {
68+
result = true;
69+
}, (error) => {
70+
result = false;
71+
});
72+
73+
return result;
5574
},
5675
handleClickAvator () {
5776
this.avatorLeft = '-180px';
5877
this.inputLeft = '0px';
5978
this.$refs.inputEle.focus();
6079
},
61-
handleUnlock () {
62-
if (this.validator()) {
80+
async handleUnlock () {
81+
if (await this.validator()) {
6382
this.avatorLeft = '0px';
6483
this.inputLeft = '400px';
6584
this.password = '';

Vue/src/views/main-components/tags-page-opened.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
<div class="close-all-tag-con">
88
<Dropdown transfer @on-click="handleTagsOption">
99
<Button size="small" type="primary">
10-
标签选项
10+
{{"LabelOptions" | l}}
1111
<Icon type="arrow-down-b"></Icon>
1212
</Button>
1313
<DropdownMenu slot="list">
14-
<DropdownItem name="clearAll">关闭所有</DropdownItem>
15-
<DropdownItem name="clearOthers">关闭其他</DropdownItem>
14+
<DropdownItem name="clearAll">{{"ClearAll" | l}}</DropdownItem>
15+
<DropdownItem name="clearOthers">{{"ClearOthers" | l}}</DropdownItem>
1616
</DropdownMenu>
1717
</Dropdown>
1818
</div>

aspnet-core/src/AbpCompanyName.AbpProjectName.Core/Localization/SourceFiles/AbpProjectName.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,9 @@
8787
<text name="ThisFieldIsRequired">This field is required</text>
8888
<text name="PleaseWait">Please wait...</text>
8989
<text name="Administration">Administration</text>
90+
91+
<text name="ClearAll">Clear all</text>
92+
<text name="ClearOthers">Clear others</text>
93+
<text name="LabelOptions">Label options</text>
9094
</texts>
9195
</localizationDictionary>

0 commit comments

Comments
 (0)