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
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
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 >
8378 ><img src =" @/assets/video.png" class =" link-icon"
8479 /></a >
8580 </div >
86- <div class =" copyright" >
87- Copyright © ; {{ curYear }} 💖flipped-aurora
88- </div >
81+ <div class =" copyright" >Copyright © ; {{ 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