瀏覽代碼

产城企业注册和个人注册增加注册完成跳转到产城注册完成页面且登录状态

hangb 7 年之前
父節點
當前提交
de7135c4f2
共有 2 個文件被更改,包括 73 次插入4 次删除
  1. 35 1
      components/register/EnterpriseRegistration.vue
  2. 38 3
      components/register/PersonalRegistration.vue

+ 35 - 1
components/register/EnterpriseRegistration.vue

@@ -788,7 +788,29 @@
                   this.loginOther(response, params, 3000)
                 }
               } else if (response.data.content.type === 'city') {
-                this.$router.push({ path: `/overRegister/cityRegisterOver${this.$store.state.option.fullPath}` })
+                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.loginCityOther(response, params)
+                    }
+                  })
+                } else {
+                  this.loginCityOther(response, params, 3000)
+                }
               } else {
                 window.location.href = '/overRegister/overEnterprise'
               }
@@ -834,6 +856,18 @@
         }).catch(() => {
           crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
         })
+      },
+      loginCityOther (response, a, timeout) {
+        const crossAfter = this.crossAfter
+        let promises = []
+        for (let i in response.data.content.loginUrls) {
+          promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
+        }
+        Promise.all(promises).then(() => {
+          crossAfter('/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath || '/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath, timeout)
+        }).catch(() => {
+          crossAfter('/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath || '/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath, timeout)
+        })
       }
     }
   }

+ 38 - 3
components/register/PersonalRegistration.vue

@@ -415,7 +415,7 @@
               .then(response => {
                 this.isShowLoading = false
                 if (response.data.success) {
-                  if (response.data.content.data) {
+                  if (response.data.content.type === 'mall') {
                     let param = response.data.content.data
                     let a = ''
                     for (let n in param) {
@@ -439,9 +439,32 @@
                     } else {
                       this.loginOther(response, params, 3000)
                     }
+                  } else if (response.data.content.type === 'city') {
+                    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.loginCityOther(response, params)
+                        }
+                      })
+                    } else {
+                      this.loginCityOther(response, params, 3000)
+                    }
                   } else {
-                    let userUU = response.data.content.userUU
-                    window.location.href = `/overRegister/${userUU}`
+                    window.location.href = '/overRegister/overEnterprise'
                   }
                 } else {
                   return Promise.reject(response.data)
@@ -550,6 +573,18 @@
         }).catch(() => {
           crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
         })
+      },
+      loginCityOther (response, a, timeout) {
+        const crossAfter = this.crossAfter
+        let promises = []
+        for (let i in response.data.content.loginUrls) {
+          promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
+        }
+        Promise.all(promises).then(() => {
+          crossAfter('/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath || '/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath, timeout)
+        }).catch(() => {
+          crossAfter('/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath || '/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath, timeout)
+        })
       }
     }
   }