methods: {
resetForm:function(){
this.formName.user = '';
this.formName.userError = '';
this.formName.password = '';
this.formName.passwordError = '';
},
isLogin:function(){
//与父组件通信传值
//this.$emit('showState', [this.beShow,this.formName.user])
//提交username password
var user = this.formName.user,
password = this.formName.password;
console.log(user,password)
axios.get('/login',{
params: {
user: user,
password: password
}
})
.then((res) => {
console.log(res.data.result);
if (res.data.result == 1) {
this.formName.user = '';
this.formName.password = '';
this.$router.push({path:'top'});
} else {
this.$notify.error({title:'Login Error',
message:'用户名或密码错误!!!',
offset:100
});
this.formName.user = '';
this.formName.password = '';
}
})
.catch(function(err){
console.log(err);
});
},