瀏覽代碼

非产城和商城注册完成逻辑修改

hangb 7 年之前
父節點
當前提交
10d8ab0e34
共有 2 個文件被更改,包括 99 次插入94 次删除
  1. 50 47
      components/register/EnterpriseRegistration.vue
  2. 49 47
      components/register/PersonalRegistration.vue

+ 50 - 47
components/register/EnterpriseRegistration.vue

@@ -763,53 +763,56 @@
           .then(response => {
             this.isShowLoading = false
             if (response.data.success) {
-              if (response.data.content.type === 'mall') {
-                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 {
-                  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)
+              console.log(response.data)
+              if (response.data.content) {
+                if (response.data.content.type === 'mall') {
+                  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 {
+                    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 {
                 window.location.href = '/overRegister/overEnterprise'

+ 49 - 47
components/register/PersonalRegistration.vue

@@ -415,53 +415,55 @@
               .then(response => {
                 this.isShowLoading = false
                 if (response.data.success) {
-                  if (response.data.content.type === 'mall') {
-                    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 {
-                      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)
+                  if (response.data.content) {
+                    if (response.data.content.type === 'mall') {
+                      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 {
+                        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