Przeglądaj źródła

ref:saas登录调整

liusw 7 lat temu
rodzic
commit
a0a3c2fb4e
1 zmienionych plików z 9 dodań i 35 usunięć
  1. 9 35
      pages/sassLogin/index.vue

+ 9 - 35
pages/sassLogin/index.vue

@@ -477,24 +477,6 @@
                   let params = a.substr(0, a.length - 1)
                   this.isShowLoading = true
                   if (response.data.content.currentUrl) {
-                    let baseContent = response.data.content.currentUrl
-                    let flag = '?'
-                    if (baseContent.indexOf('?') !== -1) {
-                      flag = '&'
-                    }
-                    this.$jsonp(`${response.data.content.currentUrl}${flag}${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)
                   }
                 }
@@ -582,20 +564,7 @@
                   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)
+                    this.loginOther(response, params, 1000)
                   }
                 }
               } else {
@@ -638,7 +607,14 @@
         // const crossAfter = this.crossAfter
         let promises = []
         for (let i in response.data.content.loginUrls) {
-          if (response.data.content.currentUrl !== response.data.content.loginUrls[i]) {
+          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 {
             promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
           }
         }
@@ -752,8 +728,6 @@
                         this.loginOther(response, params)
                       }
                     })
-                  } else {
-                    this.loginOther(response, params, 3000)
                   }
                 }
               } else {