소스 검색

邮箱验证

linweizeng 2 년 전
부모
커밋
ffbfb06a61
1개의 변경된 파일14개의 추가작업 그리고 0개의 파일을 삭제
  1. 14 0
      src/views/platform/org/employee/edit/index.vue

+ 14 - 0
src/views/platform/org/employee/edit/index.vue

@@ -232,6 +232,13 @@ export default {
             }
             }
             return true
             return true
         },
         },
+        checkEmail (value) {
+            const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
+            if (!reg.test(value)) {
+                return false
+            }
+            return true
+        },
         getUpEmployee () {
         getUpEmployee () {
             const params = {
             const params = {
                 id: this.employee.id,
                 id: this.employee.id,
@@ -267,6 +274,13 @@ export default {
                 return
                 return
             }
             }
 
 
+            const { email = '' } = vo.user || {}
+            if (email && !this.checkEmail(email)) {
+                ActionUtils.warning('请输入正确的邮箱')
+                this.dialogLoading = false
+                return
+            }
+
             if (vo.roleVoList.length > 0) {
             if (vo.roleVoList.length > 0) {
                 const list = []
                 const list = []
                 vo.roleVoList.forEach(item => {
                 vo.roleVoList.forEach(item => {