Skip to content

Commit 83b7927

Browse files
author
pixel
committed
登陆成功不再调用验证码接口
1 parent e197568 commit 83b7927

File tree

4 files changed

+102
-81
lines changed

4 files changed

+102
-81
lines changed

web/debug.log

Lines changed: 0 additions & 1 deletion
This file was deleted.

web/package-lock.json

Lines changed: 88 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/src/store/module/user.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export const user = {
4646
} else {
4747
router.push({ path: '/layout/dashboard' })
4848
}
49+
return true
4950
}
5051
},
5152
async LoginOut({ commit }) {

web/src/view/login/login.vue

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,9 @@
2020
@keyup.enter.native="submitForm"
2121
>
2222
<el-form-item prop="username">
23-
<el-input
24-
placeholder="请输入用户名"
25-
v-model="loginForm.username"
26-
>
27-
<i
28-
class="el-input__icon el-icon-user"
29-
slot="suffix"
30-
></i></el-input>
23+
<el-input placeholder="请输入用户名" v-model="loginForm.username">
24+
<i class="el-input__icon el-icon-user" slot="suffix"></i
25+
></el-input>
3126
</el-form-item>
3227
<el-form-item prop="password">
3328
<el-input
@@ -42,12 +37,12 @@
4237
></i>
4338
</el-input>
4439
</el-form-item>
45-
<el-form-item style="position:relative">
40+
<el-form-item style="position: relative">
4641
<el-input
4742
v-model="loginForm.captcha"
4843
name="logVerify"
4944
placeholder="请输入验证码"
50-
style="width:60%"
45+
style="width: 60%"
5146
/>
5247
<div class="vPic">
5348
<img
@@ -61,7 +56,7 @@
6156
</div>
6257
</el-form-item>
6358
<el-form-item>
64-
<el-button type="primary" @click="submitForm" style="width:100%"
59+
<el-button type="primary" @click="submitForm" style="width: 100%"
6560
>登 录</el-button
6661
>
6762
</el-form-item>
@@ -83,9 +78,7 @@
8378
><img src="@/assets/video.png" class="link-icon"
8479
/></a>
8580
</div>
86-
<div class="copyright">
87-
Copyright &copy; {{ curYear }} 💖flipped-aurora
88-
</div>
81+
<div class="copyright">Copyright &copy; {{ curYear }} 💖flipped-aurora</div>
8982
</div>
9083
</div>
9184
</div>
@@ -135,13 +128,15 @@ export default {
135128
methods: {
136129
...mapActions("user", ["LoginIn"]),
137130
async login() {
138-
await this.LoginIn(this.loginForm);
131+
return await this.LoginIn(this.loginForm);
139132
},
140133
async submitForm() {
141134
this.$refs.loginForm.validate(async (v) => {
142135
if (v) {
143-
this.login();
144-
this.loginVefify();
136+
const flag = await this.login();
137+
if (!flag) {
138+
this.loginVefify();
139+
}
145140
} else {
146141
this.$message({
147142
type: "error",
@@ -167,6 +162,5 @@ export default {
167162
</script>
168163

169164
<style scoped lang="scss">
170-
@import '@/style/login.scss';
171-
165+
@import "@/style/login.scss";
172166
</style>

0 commit comments

Comments
 (0)