Update add.js

This commit is contained in:
姜棚 2021-11-30 01:16:59 +08:00
parent 0e0e9c446b
commit 479c9c1fb0
1 changed files with 21 additions and 0 deletions

View File

@ -198,6 +198,27 @@ export default class add extends React.Component{
email: this.state.email_radio ? this.state.email_list[this.state.email_radio] : this.state.email email: this.state.email_radio ? this.state.email_list[this.state.email_radio] : this.state.email
} }
let phoneReg = new RegExp("^[1][3,4,5,6,7,8,9][0-9]{9}$");
let emailReg = new RegExp( "^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$");
// let data ={
// phone: this.state.phone_radio ? this.state.phone_list[this.state.phone_radio] : this.state.phone ,
// email: this.state.email_radio ? this.state.email_list[this.state.email_radio] : this.state.email
// }
if (!phoneReg.test(data.phone)) {
Notify.error("手机号格式不正确")
return;
}
if(!emailReg.test(data.email)){
Notify.error("邮箱格式不正确")
return;
}
planSend(plan_id,data).then((res)=>{ planSend(plan_id,data).then((res)=>{
handelResponse(res,(req,msg)=>{ handelResponse(res,(req,msg)=>{