yangc 8 years ago
parent
commit
a10f1a14ef
1 changed files with 18 additions and 12 deletions
  1. 18 12
      components/register-saler/register/StepFirst.vue

+ 18 - 12
components/register-saler/register/StepFirst.vue

@@ -521,18 +521,24 @@
         this.validUpload.isValidUpload = this.data.url !== ''
       },
       licenceCheck: function (num) {
-        if (num > 0) {
-          this.$http.post('/basic/enterprise/register/valid/businessCode?businessCode=' + this.data.licenceId)
-            .then(response => {
-              if (response.data.code !== 12) {
-                this.validLicence.init = false
-                this.validLicence.isValidLicence = response.data.success && this.data.licenceId
-                this.validCheck()
-              } else {
-                //      this.validLicence.init = tmpInit
-                this.licenceCheck(num - 1)
-              }
-            })
+        if ((/^\S{1,255}$/).test(this.data.licenceId)) {
+          if (num > 0) {
+            this.$http.post('/basic/enterprise/register/valid/businessCode?businessCode=' + this.data.licenceId)
+              .then(response => {
+                if (response.data.code !== 12) {
+                  this.validLicence.init = false
+                  this.validLicence.isValidLicence = response.data.success && this.data.licenceId
+                  this.validCheck()
+                } else {
+                  //      this.validLicence.init = tmpInit
+                  this.licenceCheck(num - 1)
+                }
+              })
+          }
+        } else {
+          this.validLicence.init = false
+          this.validLicence.isValidLicence = false
+          this.validCheck()
         }
       },
       addressCheck: function () {