|
|
@@ -155,25 +155,28 @@
|
|
|
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) {
|
|
|
- promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?` + a.substr(0, a.length - 1)))
|
|
|
- }
|
|
|
- Promise.all(promises).then(() => {
|
|
|
- crossAfter(response.data.content.returnUrl || 'http://www.ubtob.com')
|
|
|
- }).catch(() => {
|
|
|
- crossAfter(response.data.content.returnUrl || 'http://www.ubtob.com')
|
|
|
+ this.$jsonp(`${response.data.content.currentUrl}?${a.substr(0, a.length - 1)}`, {
|
|
|
+ name: 'successCallback',
|
|
|
+ timeout: 5000
|
|
|
+ }, (err, data) => {
|
|
|
+ if (err) {
|
|
|
+ this.$indicator.open('登录超时,请重试')
|
|
|
+ this.$indicator.close()
|
|
|
+ throw err
|
|
|
+ } else {
|
|
|
+ const crossAfter = this.crossAfter
|
|
|
+ let promises = []
|
|
|
+ for (let i in response.data.content.loginUrls) {
|
|
|
+ promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?` + a.substr(0, a.length - 1)))
|
|
|
+ }
|
|
|
+ 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 = ''
|
|
|
@@ -206,7 +209,7 @@
|
|
|
return new Promise((resolve, reject) => {
|
|
|
this.$jsonp(url, {
|
|
|
name: 'successCallback',
|
|
|
- timeout: 5000
|
|
|
+ timeout: 500
|
|
|
}, function (err, data) {
|
|
|
if (err) {
|
|
|
reject(err)
|