Parcourir la source

Merge branch 'release-iframe-hb' into dev

huangb il y a 7 ans
Parent
commit
6c68fd8dfb
2 fichiers modifiés avec 61 ajouts et 27 suppressions
  1. 1 1
      app.html
  2. 60 26
      pages/sassLogin/index.vue

+ 1 - 1
app.html

@@ -6,7 +6,7 @@
   <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"/>
   <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
   <link rel="stylesheet" href="https://unpkg.com/mint-ui/lib/style.css">
-  <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_0d1jjt5tukcblnmi.css"/>
+  <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_921977_p15nnv7y5hs.css"/>
   <!--<script src="https://wechatfe.github.io/vconsole/lib/vconsole.min.js?v=3.2.0"></script>-->
   <!--<script src="https://biheopen.bgycc.com/cordova-android.js"></script>-->
   <script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>

+ 60 - 26
pages/sassLogin/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="x-container">
    <!--登录窗口-->
-    <template>
+    <template v-if="!loginIsSuccess">
       <div class="x-login-wrap">
         <div class="login-tab" v-show="loginWay != 2">
           <span @click="toggleTab(0)" v-bind:class="{'active': loginWay === 0 }">密码登录</span>
@@ -134,20 +134,26 @@
       </div>
       <!--选择企业弹框-->
       <div>
-        <el-dialog class="dialog"
-                   :visible.sync="dialogVisible"
-                   size="tiny">
-          <div class="x-floating x-list" v-show="dialogVisible">
-            <div class="x-list-header">您要登录的公司是:</div>
-            <div class="x-list-content">
-              <ul class="list-unstyled" >
-                <template v-for="space in this.enterprise">
-                  <li v-text="space.name" @click="chooseOneEnterprise(false, space.id)">华商龙科技有限公司</li>
-                </template>
-              </ul>
-            </div>
-          </div>
-        </el-dialog>
+        <!--<el-dialog class="dialog"-->
+                   <!--:visible.sync="dialogVisible"-->
+                   <!--size="tiny">-->
+          <!--<div class="x-floating x-list" v-show="dialogVisible">-->
+            <!--<div class="x-list-header">您要登录的公司是:</div>-->
+            <!--<div class="x-list-content">-->
+              <!--<ul class="list-unstyled" >-->
+                <!--<template v-for="space in this.enterprise">-->
+                  <!--<li v-text="space.name" @click="chooseOneEnterprise(false, space.id)">华商龙科技有限公司</li>-->
+                <!--</template>-->
+              <!--</ul>-->
+            <!--</div>-->
+          <!--</div>-->
+        <!--</el-dialog>-->
+      </div>
+    </template>
+    <template v-else>
+      <div class="login-success">
+        <i class="iconfont icon-zhifuchenggong"></i>
+        <p>登录成功</p>
       </div>
     </template>
     <loading v-show="isShowLoading"/>
@@ -276,6 +282,7 @@
           username: '',
           password: ''
         },
+        loginIsSuccess: false,
         loginWay: 0,
         checked: true,
         isShowLoading: false,
@@ -476,7 +483,14 @@
                   let params = a.substr(0, a.length - 1)
                   this.isShowLoading = true
                   if (response.data.content.currentUrl) {
-                    this.$jsonp(`${response.data.content.currentUrl}?${params}`, {
+                    console.log(response.data.content.currentUrl)
+                    let baseContent = response.data.content.currentUrl
+                    console.log(baseContent)
+                    let flag = '?'
+                    if (baseContent.indexOf('?') !== -1) {
+                      flag = '&'
+                    }
+                    this.$jsonp(`${response.data.content.currentUrl}${flag}${params}`, {
                       name: 'successCallback',
                       timeout: 3000
                     }, (err, data) => {
@@ -618,15 +632,15 @@
           })
         })
       },
-      crossAfter (url) {
-        try {
-          window.location.href = url
-        } catch (err) {
-          console.log(err)
-        }
-      },
+      // crossAfter (url) {
+      //   try {
+      //     window.location.href = url
+      //   } catch (err) {
+      //     console.log(err)
+      //   }
+      // },
       loginOther (response, a, timeout) {
-        const crossAfter = this.crossAfter
+        // const crossAfter = this.crossAfter
         let promises = []
         for (let i in response.data.content.loginUrls) {
           if (response.data.content.currentUrl !== response.data.content.loginUrls[i]) {
@@ -634,9 +648,13 @@
           }
         }
         Promise.all(promises).then(() => {
-          crossAfter(response.data.content.returnUrl || 'http://www.ubtob.com', timeout)
+          this.loginIsSuccess = true
+          this.isShowLoading = false
+          // crossAfter(response.data.content.returnUrl || 'http://www.ubtob.com', timeout)
         }).catch(() => {
-          crossAfter(response.data.content.returnUrl || 'http://www.ubtob.com', timeout)
+          this.loginIsSuccess = true
+          this.isShowLoading = false
+          // crossAfter(response.data.content.returnUrl || 'http://www.ubtob.com', timeout)
         })
       },
       getCheckCode () {
@@ -878,5 +896,21 @@
        }
      }
    }
+   .login-success {
+     padding-top: 95px;
+     width: 100%;
+     height: 400px;
+     margin: 0 auto;
+     text-align: center;
+     i{
+       font-size: 125px;
+       color: #22ac38;
+     }
+     p{
+       margin-top: 20px;
+       font-size: 28px;
+       color: #333;
+     }
+   }
  }
 </style>