浏览代码

处理返回地址异常

wangcz 7 年之前
父节点
当前提交
da116e1b43
共有 2 个文件被更改,包括 24 次插入27 次删除
  1. 2 2
      components/register/EnterpriseRegistration.vue
  2. 22 25
      components/register/PersonalRegistration.vue

+ 2 - 2
components/register/EnterpriseRegistration.vue

@@ -814,11 +814,11 @@
                       this.isShowLoading = false
                       throw err
                     } else {
-                      response.data.content.type === 'city' ? this.loginCityOther(response, params) : this.loginOther(response, params)
+                      this.loginOther(response, params)
                     }
                   })
                 } else {
-                  response.data.content.type === 'city' ? this.loginCityOther(response, params, 3000) : this.loginOther(response, params, 3000)
+                  this.loginOther(response, params, 3000)
                 }
               } else {
                 let returnUrl = ''

+ 22 - 25
components/register/PersonalRegistration.vue

@@ -609,32 +609,28 @@
         })
       },
       loginStepOther (response) {
-        if (response.data.content.type) {
-          let param = response.data.content.data
-          let a = ''
-          for (let n in param) {
-            a += (n + '=' + encodeURIComponent(param[n]) + '&')
-          }
-          let params = a.substr(0, a.length - 1)
-          this.isShowLoading = true
-          if (response.data.content.currentUrl) {
-            this.$jsonp(`${response.data.content.currentUrl}?${params}`, {
-              name: 'successCallback',
-              timeout: 3000
-            }, (err, data) => {
-              if (err) {
-                this.$message.error('注册成功,请点击下方“立即登录”完成登录')
-                this.isShowLoading = false
-                throw err
-              } else {
-                response.data.content.type === 'city' ? this.loginCityOther(response, params) : this.loginOther(response, params)
-              }
-            })
-          } else {
-            response.data.content.type === 'city' ? this.loginCityOther(response, params, 5000) : this.loginOther(response, params, 5000)
-          }
+        let param = response.data.content.data
+        let a = ''
+        for (let n in param) {
+          a += (n + '=' + encodeURIComponent(param[n]) + '&')
+        }
+        let params = a.substr(0, a.length - 1)
+        this.isShowLoading = true
+        if (response.data.content.currentUrl) {
+          this.$jsonp(`${response.data.content.currentUrl}?${params}`, {
+            name: 'successCallback',
+            timeout: 3000
+          }, (err, data) => {
+            if (err) {
+              this.$message.error('注册成功,请点击下方“立即登录”完成登录')
+              this.isShowLoading = false
+              throw err
+            } else {
+              this.loginOther(response, params)
+            }
+          })
         } else {
-          window.location.href = `https://www.usoftchina.com/`
+          this.loginOther(response, params, 5000)
         }
       },
       crossAfter (url, time) {
@@ -659,6 +655,7 @@
           }
         }
         let returnUrl = this.$route.query.returnURL ? decodeURIComponent(this.$route.query.returnURL) : 'https://www.usoftchina.com/'
+        console.log(returnUrl)
         Promise.all(promises).then(() => {
           crossAfter(returnUrl, timeout)
         }).catch(() => {