|
@@ -411,8 +411,34 @@
|
|
|
.then(response => {
|
|
.then(response => {
|
|
|
this.isShowLoading = false
|
|
this.isShowLoading = false
|
|
|
if (response.data.success) {
|
|
if (response.data.success) {
|
|
|
- let userUU = response.data.content.userUU
|
|
|
|
|
- window.location.href = `/overRegister/${userUU}`
|
|
|
|
|
|
|
+ if (response.data.content.data) {
|
|
|
|
|
+ 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 {
|
|
|
|
|
+ let userUU = response.data.content.userUU
|
|
|
|
|
+ window.location.href = `/overRegister/${userUU}`
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
return Promise.reject(response.data)
|
|
return Promise.reject(response.data)
|
|
|
}
|
|
}
|
|
@@ -485,6 +511,41 @@
|
|
|
this.isShowLoading = false
|
|
this.isShowLoading = false
|
|
|
this.$message.error(err.errMsg)
|
|
this.$message.error(err.errMsg)
|
|
|
})
|
|
})
|
|
|
|
|
+ },
|
|
|
|
|
+ getJsonp: function (url, timeout = 500) {
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
|
+ this.$jsonp(url, {
|
|
|
|
|
+ name: 'successCallback',
|
|
|
|
|
+ timeout: timeout
|
|
|
|
|
+ }, function (err, data) {
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ reject(err)
|
|
|
|
|
+ throw err
|
|
|
|
|
+ } else {
|
|
|
|
|
+ resolve(data)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ crossAfter (url) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ window.location.href = url
|
|
|
|
|
+ } catch (err) {
|
|
|
|
|
+ console.log(err)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ loginOther (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}`))
|
|
|
|
|
+ }
|
|
|
|
|
+ let returnUrl = decodeURIComponent(this.$route.query.returnURL)
|
|
|
|
|
+ Promise.all(promises).then(() => {
|
|
|
|
|
+ crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|