修复登录失败的提示
This commit is contained in:
@@ -251,7 +251,7 @@ var Main = {
|
||||
submitForm(formName, url) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
var that = this;
|
||||
if (valid) {//此处暂时去除校验
|
||||
if (valid) {
|
||||
axios({
|
||||
url: getRootPath_web()+'/' + url,
|
||||
method: 'post',
|
||||
@@ -302,6 +302,54 @@ var Main = {
|
||||
handleClick(tab, event) {
|
||||
console.log(tab, event);
|
||||
},
|
||||
clickToSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
var that = this;
|
||||
if (valid) {
|
||||
axios({
|
||||
url: getRootPath_web()+'/beforeLogin',
|
||||
method: 'post',
|
||||
data: {
|
||||
colname :outSideThis.ruleForm1.colname.value,
|
||||
colpassword:outSideThis.ruleForm1.colpassword.value
|
||||
},
|
||||
transformRequest: [function (data) {
|
||||
// Do whatever you want to transform the data
|
||||
let ret = '';
|
||||
for (let it in data) {
|
||||
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
|
||||
}
|
||||
return ret
|
||||
}],
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
}).then(function (response) {
|
||||
console.log(response.data);
|
||||
if (response.data===true){
|
||||
//that.$refs[formName].submit;
|
||||
//return true;
|
||||
document.getElementById('ruleForm1').submit();
|
||||
}else if (response.data===false){
|
||||
that.openNotiError("失败", response.data.message);
|
||||
}else {
|
||||
that.openNotiError("错误", response.data.message);
|
||||
}
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
that.openNotiError("错误", "服务器错误!");
|
||||
});
|
||||
//console.log(this.$refs.content.value)
|
||||
//this.openNotiSuccess("成功", "修改成功!")
|
||||
//this.$options.methods.openNotiSuccess.bind(this)();
|
||||
//alert('submit!');
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
that.openNotiError("错误", "表单填写错误!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
showMsg(msg) {
|
||||
this.$message({
|
||||
message: msg,
|
||||
|
||||
Reference in New Issue
Block a user