13
13
<input type =" password" v-model =" account.password" autocomplete =" off" placeholder =" 请填写用户登录密码" />
14
14
</div >
15
15
<div class =" form-item password" v-if =" captchaImage" >
16
- <img class =" captcha" :src =" captchaImage" />
17
- <input type =" password " v-model =" account.captcha" autocomplete =" off" placeholder =" 请填写验证码" />
16
+ <img class =" captcha" :src =" captchaImage" @click.stop = " getCaptcha() " />
17
+ <input type =" text " v-model =" account.captcha" autocomplete =" off" placeholder =" 请填写验证码" />
18
18
</div >
19
19
<button class =" submit-btn" type =" submit" >登录</button >
20
20
</form >
23
23
</template >
24
24
25
25
<script >
26
- import { reactive , ref , onMounted , getCurrentInstance } from ' vue'
26
+ import { reactive , ref , onMounted } from ' vue'
27
27
import { useStore } from ' vuex'
28
28
import { useRouter } from ' vue-router'
29
+ import { ElMessage } from ' element-plus'
29
30
import axios from ' lin/plugin/axios'
30
31
import UserModel from ' @/lin/model/user'
31
32
import Utils from ' @/lin/util/util'
@@ -40,7 +41,6 @@ export default {
40
41
const store = useStore ()
41
42
const router = useRouter ()
42
43
const throttleLogin = ref (null )
43
- const { ctx } = getCurrentInstance ()
44
44
45
45
const account = reactive ({
46
46
username: ' ' ,
@@ -59,11 +59,12 @@ export default {
59
59
await getInformation ()
60
60
loading .value = false
61
61
router .push (Config .defaultRoute )
62
- ctx . $message ({
62
+ ElMessage ({
63
63
message: ' 登录成功' ,
64
64
type: ' success' ,
65
65
})
66
66
} catch (e) {
67
+ getCaptcha ()
67
68
loading .value = false
68
69
}
69
70
}
@@ -103,6 +104,7 @@ export default {
103
104
return {
104
105
account,
105
106
loading,
107
+ getCaptcha,
106
108
captchaImage,
107
109
throttleLogin,
108
110
}
@@ -114,8 +116,8 @@ export default {
114
116
.login {
115
117
width : 100% ;
116
118
height : 100% ;
117
- background-size : auto ;
118
119
background : #1b2c5f url (' ../../assets/image/login/login-ba.png' ) no-repeat center center ;
120
+ background-size : cover ;
119
121
120
122
.team-name {
121
123
position : fixed ;
@@ -172,6 +174,7 @@ export default {
172
174
width : 80px ;
173
175
right : 30px ;
174
176
top : -22px ;
177
+ cursor : pointer ;
175
178
}
176
179
}
177
180
0 commit comments