|
|
@@ -155,15 +155,25 @@
|
|
|
for (let n in param) {
|
|
|
a += (n + '=' + param[n] + '&')
|
|
|
}
|
|
|
+ // for (let i in response.data.content.loginUrls) {
|
|
|
+ // this.$jsonp(`${response.data.content.loginUrls[i]}?` + a.substr(0, a.length - 1), function (err) {
|
|
|
+ // if (err) throw err
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ this.$indicator.open('跳转中...')
|
|
|
+ const crossAfter = this.crossAfter
|
|
|
+ let promises = []
|
|
|
for (let i in response.data.content.loginUrls) {
|
|
|
- this.$jsonp(`${response.data.content.loginUrls[i]}?` + a.substr(0, a.length - 1), function (err) {
|
|
|
- if (err) throw err
|
|
|
- })
|
|
|
+ promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?` + a.substr(0, a.length - 1)))
|
|
|
}
|
|
|
- this.$indicator.open('跳转中...')
|
|
|
- setTimeout(function () {
|
|
|
- window.location.href = response.data.content.returnUrl || 'http://www.ubtob.com'
|
|
|
- }, 3000)
|
|
|
+ Promise.all(promises).then(() => {
|
|
|
+ crossAfter(response.data.content.returnUrl || 'http://www.ubtob.com')
|
|
|
+ }).catch(() => {
|
|
|
+ crossAfter(response.data.content.returnUrl || 'http://www.ubtob.com')
|
|
|
+ })
|
|
|
+ // setTimeout(function () {
|
|
|
+ // window.location.href = response.data.content.returnUrl || 'http://www.ubtob.com'
|
|
|
+ // }, 3000)
|
|
|
}
|
|
|
} else {
|
|
|
this.login.password = ''
|
|
|
@@ -191,6 +201,28 @@
|
|
|
iconClass: 'el-icon-error'
|
|
|
})
|
|
|
})
|
|
|
+ },
|
|
|
+ getJsonp: function (url) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$jsonp(url, {
|
|
|
+ name: 'successCallback',
|
|
|
+ timeout: 200
|
|
|
+ }, function (err, data) {
|
|
|
+ if (err) {
|
|
|
+ reject(err)
|
|
|
+ throw err
|
|
|
+ } else {
|
|
|
+ resolve(data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ crossAfter (url) {
|
|
|
+ try {
|
|
|
+ window.location.href = url
|
|
|
+ } catch (err) {
|
|
|
+ console.log(err)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|