| | |
| | | <div class="input-icon el-icon-lock"></div> |
| | | <input type="password" v-focus v-model="userInfo.password" placeholder="请è¾å
¥å¯ç " /> |
| | | </div> |
| | | <div class="item"> |
| | | <!-- <div class="item"> |
| | | <div class="input-icon el-icon-mobile"></div> |
| | | |
| | | <input v-focus type="text" v-model="userInfo.verificationCode" placeholder="è¾å
¥éªè¯ç " /> |
| | | <div class="code" @click="getVierificationCode"> |
| | | <img v-show="codeImgSrc != ''" :src="codeImgSrc" /> |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | <div class="loging-btn"> |
| | | <el-button size="large" :loading="loading" color="#3a6cd1" :dark="true" @click="login" long> |
| | |
| | | UUID: undefined |
| | | }); |
| | | |
| | | const getVierificationCode = () => { |
| | | http.get('/api/User/getVierificationCode').then((x) => { |
| | | codeImgSrc.value = 'data:image/png;base64,' + x.img; |
| | | userInfo.UUID = x.uuid; |
| | | }); |
| | | }; |
| | | getVierificationCode(); |
| | | // const getVierificationCode = () => { |
| | | // http.get('/api/User/getVierificationCode').then((x) => { |
| | | // codeImgSrc.value = 'data:image/png;base64,' + x.img; |
| | | // userInfo.UUID = x.uuid; |
| | | // }); |
| | | // }; |
| | | //getVierificationCode(); |
| | | |
| | | let appContext = getCurrentInstance().appContext; |
| | | let $message = appContext.config.globalProperties.$message; |
| | |
| | | const login = () => { |
| | | if (!userInfo.userName) return $message.error('请è¾å
¥ç¨æ·å'); |
| | | if (!userInfo.password) return $message.error('请è¾å
¥å¯ç '); |
| | | if (!userInfo.verificationCode) { |
| | | return $message.error('请è¾å
¥éªè¯ç '); |
| | | } |
| | | // if (!userInfo.verificationCode) { |
| | | // return $message.error('请è¾å
¥éªè¯ç '); |
| | | // } |
| | | loading.value = true; |
| | | http.post('/api/User/login', userInfo, 'æ£å¨ç»å½....').then((result) => { |
| | | if (!result.status) { |
| | | loading.value = false; |
| | | getVierificationCode(); |
| | | //getVierificationCode(); |
| | | return $message.error(result.message); |
| | | } |
| | | $message.success('ç»å½æå,æ£å¨è·³è½¬!'); |
| | |
| | | return { |
| | | loading, |
| | | codeImgSrc, |
| | | getVierificationCode, |
| | | //getVierificationCode, |
| | | login, |
| | | userInfo, |
| | | loginPress, |