getSmscode() {
var reg = /^1[3|4|5|7|8][0-9]\d{8}$/
if (this.registerInfo.phone == "") {
this.$message({
message: "请输入手机号码",
type: "warning"
});
} else if (!reg.test(this.registerInfo.phone)) {
this.$message({
message: "号码格式不正确",
type: "warning"
});
} else {
this.fromdataSmscode.append("phone", this.registerInfo.phone);
this.$axios.post(url.sendSMS, this.fromdataSmscode).then(response => {
console.log(response);
this.$message({
message: "发送成功,请注意查收",
type: "success"
})
this.getCode()
})
.catch(response => {
console.log(response);
this.$message(response.data.errorMessage);
})
}
}