1313 <input type =" password" v-model =" account.password" autocomplete =" off" placeholder =" 请填写用户登录密码" />
1414 </div >
1515 <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 =" 请填写验证码" />
1818 </div >
1919 <button class =" submit-btn" type =" submit" >登录</button >
2020 </form >
2323</template >
2424
2525<script >
26- import { reactive , ref , onMounted , getCurrentInstance } from ' vue'
26+ import { reactive , ref , onMounted } from ' vue'
2727import { useStore } from ' vuex'
2828import { useRouter } from ' vue-router'
29+ import { ElMessage } from ' element-plus'
2930import axios from ' lin/plugin/axios'
3031import UserModel from ' @/lin/model/user'
3132import Utils from ' @/lin/util/util'
@@ -40,7 +41,6 @@ export default {
4041 const store = useStore ()
4142 const router = useRouter ()
4243 const throttleLogin = ref (null )
43- const { ctx } = getCurrentInstance ()
4444
4545 const account = reactive ({
4646 username: ' ' ,
@@ -59,11 +59,12 @@ export default {
5959 await getInformation ()
6060 loading .value = false
6161 router .push (Config .defaultRoute )
62- ctx . $message ({
62+ ElMessage ({
6363 message: ' 登录成功' ,
6464 type: ' success' ,
6565 })
6666 } catch (e) {
67+ getCaptcha ()
6768 loading .value = false
6869 }
6970 }
@@ -103,6 +104,7 @@ export default {
103104 return {
104105 account,
105106 loading,
107+ getCaptcha,
106108 captchaImage,
107109 throttleLogin,
108110 }
@@ -114,8 +116,8 @@ export default {
114116.login {
115117 width : 100% ;
116118 height : 100% ;
117- background-size : auto ;
118119 background : #1b2c5f url (' ../../assets/image/login/login-ba.png' ) no-repeat center center ;
120+ background-size : cover ;
119121
120122 .team-name {
121123 position : fixed ;
@@ -172,6 +174,7 @@ export default {
172174 width : 80px ;
173175 right : 30px ;
174176 top : -22px ;
177+ cursor : pointer ;
175178 }
176179 }
177180
0 commit comments