|
@@ -165,31 +165,39 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- sendEmail() {
|
|
|
- let timerId = setInterval(() => {
|
|
|
- this.CountDown--
|
|
|
- this.isDisabled = true
|
|
|
- this.buttonName = this.CountDown + 's'
|
|
|
- if (this.CountDown <= 0) {
|
|
|
- clearInterval(timerId)
|
|
|
- this.buttonName = 'send'
|
|
|
- this.CountDown = 60
|
|
|
- this.isDisabled = false
|
|
|
- }
|
|
|
- }, 1000)
|
|
|
- if (!this.isDisabled) {
|
|
|
- //发送邮件
|
|
|
- get(
|
|
|
- '/pdf-tech/auth/getVerifyCode?action=0&type=0&receiver=' +
|
|
|
- this.ruleForm.email
|
|
|
- ).then((res) => {
|
|
|
- if(res.data.code === 200){
|
|
|
- this.$message({
|
|
|
- message: 'Email sent successfully',
|
|
|
- type: "success"
|
|
|
- })
|
|
|
- }
|
|
|
+ sendEmail(){
|
|
|
+ const regEmail = /^([A-Za-z0-9_\-.])+@([A-Za-z0-9_\-.])+\.([A-Za-z]{2,4})$/
|
|
|
+ if(!regEmail.test(this.ruleForm.email)){
|
|
|
+ this.$message({
|
|
|
+ message: 'Invalid Email Addresses',
|
|
|
+ type: "error"
|
|
|
})
|
|
|
+ } else {
|
|
|
+ let timerId = setInterval(() => {
|
|
|
+ this.CountDown--
|
|
|
+ this.isDisabled = true
|
|
|
+ this.buttonName = this.CountDown + 's'
|
|
|
+ if (this.CountDown <= 0) {
|
|
|
+ clearInterval(timerId)
|
|
|
+ this.buttonName = 'send'
|
|
|
+ this.CountDown = 60
|
|
|
+ this.isDisabled = false
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
+ if (!this.isDisabled) {
|
|
|
+ //发送邮件
|
|
|
+ get(
|
|
|
+ '/pdf-tech/auth/getVerifyCode?action=0&type=0&receiver=' +
|
|
|
+ this.ruleForm.email
|
|
|
+ ).then((res) => {
|
|
|
+ if(res.data.code === 200){
|
|
|
+ this.$message({
|
|
|
+ message: 'Email sent successfully',
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
changeEmail() {
|