Commit 8b847f86 by 杜亚谦

验证码

parent 4df7e435
......@@ -21,12 +21,10 @@ export function login(loginID, loginPas) {
export function getCode(yzm){
var t = (new Date).getTime(); //每次点击重新取个随机数
return request({
url: 'http://192.168.3.110:8999/diseaseControlManage/api/login/captcha?t='+t+'&code='+yzm,
url: 'http://192.168.3.110:8999/diseaseControlManage/api/login/verify?t='+t+'&code='+yzm,
method:'post',
data: {},
async:false, //同步
})
}
......
......@@ -36,7 +36,7 @@
</template>
<script>
import {login, getCode} from '@/api/userlogin.js'
import { getCode,login} from '@/api/userlogin.js'
export default {
data() {
......@@ -69,13 +69,16 @@
let _this = this
// getCode(this.captcha_code).then(res=>{
// console.log(res)
// })
getCode(this.captcha_code).then( res =>{
console.log(res)
console.log("登录报错!");
}).catch(err => {
// console.log("登录报错!");
})
// 用户登录
login(this.loginID, this.$md5(this.loginPas)).then(res => {
//login(this.loginID,this.loginPas).then( res=>{
console.log(res)
//login(this.loginID,this.loginPas).then( res=>{
if (res.code == 1) {
sessionStorage.setItem('token', res.data.token);
sessionStorage.setItem('userinfo', JSON.stringify(res.data.userInfo));
......@@ -128,7 +131,7 @@
},
mounted() {
this.$refs.code.setAttribute(
this.$refs.code.setAttribute(
"src", 'http://192.168.3.110:8999/diseaseControlManage/api/login/captcha'
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment