Преглед изворни кода

Merge branch 'hotfix/saaslogin-liusw' into dev

liusw пре 7 година
родитељ
комит
1ad1f608c8
1 измењених фајлова са 19 додато и 10 уклоњено
  1. 19 10
      pages/sassLogin/index.vue

+ 19 - 10
pages/sassLogin/index.vue

@@ -607,20 +607,29 @@
         // const crossAfter = this.crossAfter
         let promises = []
         for (let i in response.data.content.loginUrls) {
-          if (response.data.content.currentUrl === response.data.content.loginUrls[i]) {
-            let baseContent = response.data.content.currentUrl
-            let flag = '?'
-            if (baseContent.indexOf('?') !== -1) {
-              flag = '&'
-            }
-            promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}${flag}${a}`))
-          } else {
+          if (response.data.content.currentUrl !== response.data.content.loginUrls[i]) {
             promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
           }
         }
         Promise.all(promises).then(() => {
-          this.loginIsSuccess = true
-          this.isShowLoading = false
+          let baseContent = response.data.content.currentUrl
+          let flag = '?'
+          if (baseContent.indexOf('?') !== -1) {
+            flag = '&'
+          }
+          this.$jsonp(`${response.data.content.currentUrl}${flag}${a}`, {
+            name: 'successCallback',
+            timeout: 3000
+          }, (err, data) => {
+            if (err) {
+              this.$message.error('登录超时,请重试')
+              this.isShowLoading = false
+              throw err
+            } else {
+              this.loginIsSuccess = true
+              this.isShowLoading = false
+            }
+          })
           // crossAfter(response.data.content.returnUrl || 'http://www.ubtob.com', timeout)
         }).catch(() => {
           this.loginIsSuccess = true