Эх сурвалжийг харах

Merge branch 'master' into wang20180224-mobile

# Conflicts:
#	Dockerfile
hangb 7 жил өмнө
parent
commit
1aba4c2345
38 өөрчлөгдсөн 2027 нэмэгдсэн , 332 устгасан
  1. 8 1
      .babelrc
  2. 16 2
      app.html
  3. 88 1
      assets/scss/common.scss
  4. 1 1
      assets/scss/mobileCommon.scss
  5. 2 2
      components/appeal/PasswordRestAppeal.vue
  6. 2 1
      components/certification/RealNameCertification.vue
  7. 1 1
      components/default/AccountCenterHeader.vue
  8. 308 0
      components/default/RegisterCenterHeader.vue
  9. 2 1
      components/default/index.js
  10. 1 1
      components/encrypted-setting/EncryptedSettingSecondStep.vue
  11. 391 73
      components/login/Login.vue
  12. 10 2
      components/mobile/footerMobile.vue
  13. 57 14
      components/mobile/loginMobile.vue
  14. 77 6
      components/mobile/registerEnterprise/index.vue
  15. 63 2
      components/mobile/registerPersonal/index.vue
  16. 5 1
      components/mobile/reset/stepLast.vue
  17. 74 0
      components/register/CityRegisterOver.vue
  18. 326 138
      components/register/EnterpriseRegistration.vue
  19. 235 41
      components/register/PersonalRegistration.vue
  20. 2 1
      components/register/index.js
  21. 1 1
      components/reset/ChangePasswordChooseStyle.vue
  22. 10 0
      layouts/isCityFooter.vue
  23. 1 1
      layouts/mobile.vue
  24. 1 1
      nuxt.config.js
  25. 2 1
      package.json
  26. 104 20
      pages/agency/index.vue
  27. 6 3
      pages/common/agreement.vue
  28. 133 0
      pages/common/cityAgreement.vue
  29. 4 1
      pages/index.vue
  30. 3 1
      pages/logquit/index.vue
  31. 27 0
      pages/overRegister/cityRegisterOver.vue
  32. 10 4
      pages/register/enterpriseRegistration.vue
  33. 10 9
      pages/register/personalRegistration.vue
  34. 0 1
      plugins/axios.js
  35. BIN
      static/images/all/success.png
  36. BIN
      static/images/all/sucess.png
  37. 18 0
      store/index.js
  38. 28 0
      store/login.js

+ 8 - 1
.babelrc

@@ -3,5 +3,12 @@
     "es2015",
     "stage-2"
   ],
-  "plugins": []
+  "plugins": [
+    ["transform-runtime", {
+      "helpers": false, // defaults to true
+      "polyfill": false, // defaults to true
+      "regenerator": false, // defaults to true
+      "moduleName": "babel-runtime" // defaults to "babel-runtime"
+    }]
+  ]
 }

+ 16 - 2
app.html

@@ -34,10 +34,10 @@
         var recalc = function () {
           var clientWidth = docEl.clientWidth
           if (!clientWidth) return
-          if (clientWidth >= 750) {
+          if (clientWidth >= 640) {
             docEl.style.fontSize = '100px'
           } else {
-            docEl.style.fontSize = 100 * (clientWidth / 750) + 'px'
+            docEl.style.fontSize = 100 * (clientWidth / 640) + 'px'
           }
         }
 //        recalc()
@@ -51,6 +51,20 @@
   </script>
 </head>
 <body {{ BODY_ATTRS }}>
+  <div id="result" class="com-result">
+      <span class="text">
+        <em>*</em>您的浏览器版本过低,部分功能可能无法正常使用,请下载IE10及以上版本</span>
+    <a class="close-tip" onclick="resultClose()">&times;</a>
+  </div>
 {{ APP }}
 </body>
+<script>
+  if(navigator.appName == "Microsoft Internet Explorer"&&parseInt(navigator.appVersion.split(";")[1].replace(/[ ]/g, "").replace("MSIE",""))<10){
+    var el = document.getElementById('result')
+    function resultClose () {
+      el.setAttribute('style', 'display:none;')
+    }
+    el.setAttribute('style', 'display:block;')
+  }
+</script>
 </html>

+ 88 - 1
assets/scss/common.scss

@@ -386,7 +386,32 @@ form .el-form-item .el-form-item__content .el-textarea .el-textarea__inner{
   border-top: 0 !important;
   border-left: 0 !important;
 }
-
+form .text-position .el-form-item__content{
+  line-height: 20px;
+}
+form .text-position .el-form-item__content .el-checkbox .el-checkbox__inner{
+  margin-top: -1px;
+  width: 14px;
+  height: 14px;
+  border: 1px solid #ccc;
+}
+form .text-position .el-form-item__content .el-checkbox .el-checkbox__label{
+  padding-left: 8px;
+  font-size: 12px;
+  color: #606266;
+}
+form .text-position .el-form-item__content .el-checkbox .el-checkbox__input.is-checked+.el-checkbox__label {
+  color: #2d8cf0;
+}
+form .text-position .el-checkbox__input.is-checked .el-checkbox__inner{
+  background-color: #5078cb!important;
+  border-color: transparent!important;
+}
+form .text-position .el-checkbox__inner::after {
+  border: 2px solid #fff !important;
+  border-top: 0 !important;
+  border-left: 0 !important;
+}
 //登录页面样式
 //错误提示框变红隐藏
 .login-form .el-form-item.is-error .el-input__inner, .login-form .el-form-item.is-error .el-input__inner:focus, .login-form .el-form-item.is-error .el-textarea__inner, .login-form .el-form-item.is-error .el-textarea__inner:focus, .login-form .el-message-box__input input.invalid, .login-form .el-message-box__input input.invalid:focus {
@@ -467,7 +492,27 @@ form .el-form-item .el-form-item__content .el-textarea .el-textarea__inner{
   height: 34px;
   line-height: 30px;
 }
+//短信便捷登录
+.loginForm .el-input__inner{
+  padding-left: 12px !important;
+}
+.login-form .fastMsg .el-button.fastCode{
+  position: absolute;
+  top: 2px;
+  right: 0;
+  padding: 0;
+  width: 93px;
+  height: 34px;
+  font-size: 12px;
+  text-align: center;
+  border: none;
+  color: #fff;
+  background: #5078cb;
+}
 
+.login-form .fastMsg .el-button.code-send{
+  background: #cccccc;
+}
 //个人注册错误框颜色
 form .el-form-item .el-form-item__content div.active .el-input__inner{
   border-color: #f56c6c !important;
@@ -804,3 +849,45 @@ form .questions .el-form-item__content span.question {
   position: relative;
   z-index: 10;
 }
+
+
+
+//ie9及以下提示框
+
+.com-result{
+  display: none;
+  position: relative;
+  height: 30px;
+  width: 100%;
+  line-height: 30px;
+  text-align: center;
+  background: #fef6f2;
+  border: 1px solid #ec854d;
+  overflow: hidden ;
+}
+.com-result .text{
+  width: 100%;
+  text-align: center;
+  font-size: 14px;
+  color: #f15601;
+}
+.com-result .text em{
+  margin-right: 3px;
+  font-style: normal;
+}
+.com-result .text a {
+  color: #5078cb;
+}
+.com-result .close-tip{
+  position: absolute;
+  right: 0;
+  padding-right: 10px;
+  font-size: 20px;
+  font-weight: bold;
+  color: #ef1d1d;
+  line-height: 28px;
+}
+
+.clear-float {
+  clear: both;
+}

+ 1 - 1
assets/scss/mobileCommon.scss

@@ -16,7 +16,7 @@
   .img-list{
     .item{
       display:inline-block;
-      width:45%;
+      width:44%;
       height: 2.2rem;
       text-align: center;
       margin:0 .15rem .15rem;

+ 2 - 2
components/appeal/PasswordRestAppeal.vue

@@ -26,7 +26,7 @@
               <span v-show="codeErrorChecked" class="tip codeError-tip" >{{codeErrorMsg}}</span>
             </el-form-item>
             <el-form-item prop="password">
-              <el-input type="password" v-model="passwordRest.password" auto-complete="off" placeholder="新密码"></el-input>
+              <el-input type="password" v-model="passwordRest.password" auto-complete="new-password" placeholder="新密码"></el-input>
               <div class="pwd sm" v-show="showMsgTip1">密码强度 <em></em><em></em><em></em><span>弱</span></div>
               <div class="pwd md" v-show="showMsgTip2">密码强度 <em></em><em></em><em></em><span>中</span></div>
               <div class="pwd lar" v-show="showMsgTip3">密码强度 <em></em><em></em><em></em><span>强</span></div>
@@ -36,7 +36,7 @@
               <el-input type="password"
                         v-model="passwordRest.confirm"
                         v-bind:class="{active: showPasswordError}"
-                        auto-complete="off"
+                        auto-complete="new-password"
                         placeholder="密码确认"></el-input>
               <span class="tip passwordError" v-show="showPasswordError">两次输入密码不一致</span>
             </el-form-item>

+ 2 - 1
components/certification/RealNameCertification.vue

@@ -127,9 +127,10 @@
                   }
                 }).catch(err => {
                   this.$message.error(err.errMsg)
-                  console.log(err.content.isValid)
                 })
             } else {
+              this.idCardChecked = false
+              this.idCardHasCertification = false
               callback(new Error('请填写正确的身份证号'))
             }
           }

+ 1 - 1
components/default/AccountCenterHeader.vue

@@ -4,7 +4,7 @@
       <div class="navbar-container container">
         <div class="navbar-header">
           <a href="http://www.ubtob.com" class="item navbar-link">
-            <img src="/images/logo/uas.png" class="navbar-logo">
+            <img src="https://dfs.ubtob.com/group1/M00/62/0F/CgpkyFp3uZmAHIU6AAANkRVx1Gk236.png" class="navbar-logo">
           </a>
           <a href=""><span class="navbar-slogan">账号中心</span></a>
         </div>

+ 308 - 0
components/default/RegisterCenterHeader.vue

@@ -0,0 +1,308 @@
+<template>
+  <header class="header">
+    <nav class="navbar">
+      <div class="navbar-container container">
+        <div class="navbar-header">
+          <a :href="(loginStyle && loginStyle.returnHomeUrl) ? JSON.parse(loginStyle.returnHomeUrl).url : ''" class="item navbar-link">
+            <img :src="(loginStyle && loginStyle.logoUrl) ? loginStyle.logoUrl : 'https://dfs.ubtob.com/group1/M00/62/0F/CgpkyFp3uZmAHIU6AAANkRVx1Gk236.png'" class="navbar-logo">
+          </a>
+          <a href=""><span class="navbar-slogan">账号中心</span></a>
+        </div>
+      </div>
+    </nav>
+  </header>
+</template>
+<script>
+  export default {
+    name: 'AccountCenterHeader',
+    data () {
+      return {}
+    },
+    computed: {
+      loginStyle () {
+        return this.$store.state.login.loginStyle.data.content
+      }
+//      user () {
+//        return this.$store.state.option.user
+//      },
+//      enterprise () {
+//        let ens = this.user.data.enterprises
+//        if (ens && ens.length) {
+//          return ens.find(item => item.current) || {enName: '个人账户'}
+//        } else {
+//          return {enName: '个人账户'}
+//        }
+//      },
+//      sortEnterprises () {
+//        let ens = this.user.data.enterprises
+//        if (ens && ens.length) {
+//          ens.sort(function (a, b) {
+//            return b.lastLoginTime - a.lastLoginTime
+//          })
+//        }
+//        return ens
+//      },
+//      url () {
+//        return this.$store.state.option.url
+//      }
+    },
+    methods: {
+//      logout () {
+//        this.$http.get('/logout/crossBefore').then(response => {
+//          if (response.data) {
+//            window.location.href = response.data.logoutUrl + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+//          }
+//        })
+//      },
+//      onLoginClick () {
+//        this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
+//          if (response.data) {
+//            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+//          }
+//        })
+//      },
+//      onRegisterClick () {
+//        this.$http.get('/register/page').then(response => {
+//          if (response.data) {
+//            window.location.href = response.data.content
+//          }
+//        })
+//      },
+//      // 切换当前企业
+//      switchEnterprise (en) {
+//        this.showEnterpriseToggle = false
+//        this.$http.get(`/user/authentication/${en.uu}`).then(() => {
+//          this.$store.dispatch('loadUserInfo')
+//          window.location.href = '/'
+//        })
+//      },
+//      toVendor: function () {
+//        let isSelf = true
+//        let tempEnterprise = {}
+//        let ens = this.user.data.enterprises
+//        if (ens && ens.length) {
+//          ens.forEach(function (item) {
+//            if (item.current) {
+//              isSelf = false
+//              tempEnterprise = item
+//            }
+//          })
+//        } else {
+//          isSelf = true
+//        }
+//        if (isSelf) {
+//          window.location.href = '/register-saler'
+//        } else {
+//          if (tempEnterprise.isVendor === 313) {
+//            window.location.href = '/vendor#/index'
+//          } else {
+//            window.location.href = '/register-saler'
+//          }
+//        }
+//      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  @import '~assets/scss/mixins';
+  @import '~assets/scss/variables';
+
+  $nav-height: 60px;
+  $nav-boxshadow: 2px 2px 5px rgba(0,0,0,.12);
+  $nav-color: #3c3c3c;
+  .header .navbar{
+    min-height: inherit;
+    border-radius: 0;
+  }
+  .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu li span,.header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu li a{
+    font-size: 12px;
+  }
+  .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu .menu-item a{
+    width: 100%;
+    display: inline-block;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    height: 25px;
+  }
+  .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu .menu-item{
+    height: 30px;
+  }
+  .dropdown-menu>li>a{
+    padding: 0;
+    line-height: 30px;
+  }
+  .dropdown-menu>li a:hover{
+    background: none;
+    text-decoration: underline !important;
+  }
+  .header {
+    height: $nav-height;
+
+  .navbar {
+    width: 100%;
+    height: 100%;
+    font-size: $font-size-small;
+    background-color: $black-light;
+    box-shadow: $nav-boxshadow;
+    -o-box-shadow: $nav-boxshadow;
+    -moz-box-shadow: $nav-boxshadow;
+    -webkit-box-shadow: $nav-boxshadow;
+
+  .navbar-container {
+
+  .item-wrap {
+    display: inline-block;
+  }
+
+  .item {
+    color: $nav-color;
+    display: inline-block;
+    height: $nav-height;
+    line-height: $nav-height;
+  }
+
+  a {
+    position: relative;
+    color: $nav-color;
+    font-weight: bold;
+    font-size: 16px;
+    > span:before{
+        content: '';
+        position: absolute;
+        top: 5px;
+        left: 16px;
+        width: 1px;
+        height: 14px;
+        background: #bfbfbf;
+      }
+  }
+
+  .navbar-header {
+    float: left;
+
+  .navbar-logo {
+    margin-bottom: 2px;
+  }
+
+  .navbar-slogan {
+    margin-left: $sm-pad;
+  }
+
+  }
+
+  .navbar-right {
+    float: right;
+
+  .item {
+    padding: 0 $pad;
+  }
+
+  .dropdown {
+  .dropdown-toggle {
+    line-height: $nav-height;
+    border-left: 1px solid $black-light;
+    border-right: 1px solid $black-light;
+    height: 35px;
+  a {
+    margin-left: 15px;
+    float: right;
+  &:hover {
+     color: $red !important;
+   }
+  }
+  &:hover {
+     border-left: 1px solid #999;
+     border-right: 1px solid #999;
+   }
+  span {
+    display: inline-block;
+    max-width: 190px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    float: right;
+  }
+  }
+  .menu-item-first {
+    background: #eee;
+    padding: 0 12px;
+    line-height: 30px;
+    font-size: 12px;
+  >span:nth-child(1) {
+     cursor: default;
+     font-weight: bold;
+   }
+  input {
+    width: 174px;
+    height: 24px;
+    margin-left: 35px;
+    background: #fff;
+    border: 1px solid #5078cb;
+    padding-left: 4px;
+  }
+  .search-enterprise {
+    display: inline-block;
+    width: 36px;
+    height: 24px;
+    color: #fff;
+    background: #5078cb;
+    text-align: center;
+    line-height: 24px;
+    cursor: pointer;
+  }
+  }
+
+  .dropdown-menu {
+    padding: 0 6px 13px;
+    margin:0;
+    border-radius: 0;
+    right: unset;
+    background: #fff;
+    border: 1px solid #999999;
+    border-top: none;
+    -webkit-box-shadow: none;
+    -moz-box-shadow: none;
+    box-shadow: none;
+
+  ::-webkit-scrollbar {
+    background: #f6f6f6;
+  }
+
+  ul {
+    max-height: 300px;
+    overflow-y: auto;
+    background: #f6f6f6;
+  }
+
+  .menu-item {
+    padding: 0 12px;
+  a {
+    color: #333;
+    max-width: 300px;
+    line-height: 30px;
+    width: auto;
+  &:hover {
+     color: #5078cb;
+     text-decoration: none!important;
+   }
+  }
+  }
+  }
+
+  &:hover {
+     background-color: $white;
+
+  .dropdown-toggle {
+    color: $text;
+  }
+  a {
+    color: $text
+  }
+  }
+  }
+  }
+  }
+  }
+  }
+</style>

+ 2 - 1
components/default/index.js

@@ -4,5 +4,6 @@ import LoginHeader from './LoginHeader.vue'
 import CommonFooter from './CommonFooter.vue'
 import ManualAppealHeader from './ManualAppealHeader.vue'
 import EmailLinkPage from './EmailLinkPage.vue'
+import RegisterCenterHeader from './RegisterCenterHeader.vue'
 
-export { AccountCenterHeader, CloudHeader, LoginHeader, CommonFooter, ManualAppealHeader, EmailLinkPage }
+export { AccountCenterHeader, CloudHeader, LoginHeader, CommonFooter, ManualAppealHeader, EmailLinkPage, RegisterCenterHeader }

+ 1 - 1
components/encrypted-setting/EncryptedSettingSecondStep.vue

@@ -24,7 +24,7 @@
                 <el-input v-model="valid2.answer1" placeholder="答案一"></el-input>
               </el-form-item>
               <el-form-item prop="question2">
-              <el-select v-model="valid2.question2" placeholder="问题">
+              <el-select v-model="valid2.question2" placeholder="问题">
                 <el-option label="您的爷爷叫什么名字?" value="您的爷爷叫什么名字?"></el-option>
                 <el-option label="您的配偶的生日是几月几日?" value="您的配偶的生日是几月几日?"></el-option>
                 <el-option label="您最喜欢的歌手是谁?" value="您最喜欢的歌手是谁?"></el-option>

+ 391 - 73
components/login/Login.vue

@@ -4,13 +4,15 @@
     <nav class="x-navbar">
       <div class="container">
         <div class="navbar-header">
-          <input type="hidden" name="iconUrl" value="/static/img/icon_mall_index.png">
-          <a class="navbar-brand" id="navbar-brand">
-            欢迎登录
+          <input type="hidden" name="iconUrl" value="">
+          <a class="navbar-brand" :href="!loginStyle || (loginStyle && (JSON.parse(loginStyle.returnHomeUrl).url)) || ''">
+            <img :src="loginStyle.logoUrl" alt="">
+            <span>{{loginStyle.title || ''}}</span>
           </a>
         </div>
         <div class="collapse navbar-collapse navbar-right">
-          <a href="http://www.ubtob.com">优软云首页</a> <a href="http://uas.ubtob.com/serve#/">帮助</a>
+          <a :href="loginStyle ? JSON.parse(loginStyle.returnHomeUrl).url : ''">{{loginStyle ? JSON.parse(loginStyle.returnHomeUrl).name : ''}}</a>
+          <a href="http://uas.ubtob.com/serve#/" v-if="!loginStyle || (loginStyle && (JSON.parse(loginStyle.returnHomeUrl).needHelp))">帮助</a>
         </div>
       </div>
     </nav>
@@ -19,8 +21,16 @@
       <div class="x-banner-wrap">
         <div class="x-banner">
           <ul class="list-unstyled">
-            <li id="bgStyle">
-              <a>
+            <li id="bgStyle" v-bind:style="{ background: `url(${loginStyle.bgUrl}) center center/auto 100% no-repeat ${loginStyle.bgColor}` }">
+              <a :href="loginStyle.bgLink" v-if="loginStyle.bgLink">
+                <div class="inner">
+                  <div class="x-title x-text-0"></div>
+                  <div class="x-subtitle x-text-0"></div>
+                  <div class="x-btn-group">
+                  </div>
+                </div>
+              </a>
+              <a v-else style="cursor: default">
                 <div class="inner">
                   <div class="x-title x-text-0"></div>
                   <div class="x-subtitle x-text-0"></div>
@@ -36,16 +46,19 @@
         <div class="x-login">
           <!-- user & pwd login wrap -->
           <div id="form-wrap" class="x-login-form">
-            <div>
+            <!--账号密码登录-->
+            <div v-show="activeTab === 0">
               <el-form :model="login" :rules="rules2" ref="login" class="demo-ruleForm login-form">
                 <el-form-item prop="username">
-                  <el-input type="text" v-model="login.username" auto-complete="off" placeholder="手机号/邮箱/账号ID"></el-input>
+                  <el-input type="text" v-model="login.username" auto-complete="new-password" placeholder="手机号/邮箱"></el-input>
                   <i class="fa fa-user"></i>
                 </el-form-item>
                 <el-form-item prop="password">
+                  <input autocomplete="new-password"
+                         type="password" style="display: none;width:0;height:0;">
                   <el-input type="password"
                             v-model="login.password"
-                            auto-complete="off"
+                            auto-complete="new-password"
                             placeholder="密码"
                             @keyup.enter.native="isLogin(true)"></el-input>
                   <i class="fa fa-lock"></i>
@@ -59,7 +72,10 @@
                   <img id="captchaImage" class="code-img" src="/sso/login/checkCode"/>
                   <a class="code-click" @click="getCode">看不清换一张</a>
                 </el-form-item>
-                <el-form-item class="text-right">
+                <el-form-item class="text-position">
+                  <div class="page-part" v-if="loginStyle.needRememberPwd">
+                    <el-checkbox v-model="checked">记住密码</el-checkbox>
+                  </div>
                   <a class="forget" id='forget' @click="goForgetPassword">忘记密码?</a>
                 </el-form-item>
                 <el-form-item>
@@ -69,11 +85,33 @@
                 </el-form-item>
               </el-form>
             </div>
+            <!--短信快捷登录-->
+            <div v-show="activeTab === 1">
+              <el-form :model="fastLogin" :rules="rules3" ref="fastLogin" class="demo-ruleForm login-form loginForm">
+                <el-form-item prop="mobile">
+                  <el-input type="text" v-model="fastLogin.mobile" auto-complete="off" placeholder="请输入手机号"></el-input>
+                </el-form-item>
+                <el-form-item prop="code" class="fastMsg">
+                  <el-input type="text" v-model="fastLogin.code"
+                            auto-complete="off" placeholder="验证码"></el-input>
+                  <el-button type="primary" class="fastCode"
+                             v-show="sendLoginCode"
+                             @click="getCheckCode">获取验证码</el-button>
+                  <el-button type="primary"  v-show="!sendLoginCode" class="fastCode code-send">已发送({{login_time}}s)</el-button>
+                </el-form-item>
+                <el-form-item>
+                  <a class="btn login"
+                     @click="fastToLogin(true)">登录</a>
+                </el-form-item>
+              </el-form>
+            </div>
             <div class="warn-text-area">
               为确保您账户的安全及正常使用,依《网络安全法》相关要求,6月1日起会员账户需绑定手机、设置密码保护。感谢您的理解和支持!
             </div>
             <div class="link-go">
               <a @click="changeManage" class="first">更换管理员</a>
+              <a class='change' @click="activeTab = 1" v-show="activeTab === 0">短信快捷登录</a>
+              <a class='change' @click="activeTab = 0" v-show="activeTab === 1">用户密码登录</a>
               <a id="register" @click="goRegister" class="second">
                 <i class="fa fa-arrow-circle-o-right"></i>免费注册</a>
             </div>
@@ -115,6 +153,8 @@
       </div>
       <loading v-show="isShowLoading"/>
     </div>
+    <!--尾部-->
+    <div v-html="loginStyle.footUrl || ''" class="footer"></div>
   </div>
 </template>
 
@@ -150,6 +190,9 @@
                     if (getPasswordErrorCount === 3) {
                       this.$message.error('当前已输错密码3次,若达到5次今日将无法登陆')
                     }
+                    if (getPasswordErrorCount === 4) {
+                      this.$message.error('当前已输错密码4次,若达到5次今日将无法登陆')
+                    }
                     this.isLoginDisabled = false
                     this.checkUsername = true
                     this.showCheckCode = true
@@ -179,6 +222,25 @@
           callback()
         }
       }
+      // 短信便捷登录
+      var validateMobile = (rule, value, callback) => {
+        if (value === '') {
+          this.checkMobile = false
+        } else {
+          this.checkMobile = true
+          callback()
+        }
+      }
+      var validateCode = (rule, value, callback) => {
+        if (value === '') {
+          this.checkCode = false
+        } else {
+          if (this.fastLogin.code !== '') {
+            this.checkCode = true
+          }
+          callback()
+        }
+      }
       return {
         login: {
           username: '',
@@ -186,6 +248,12 @@
           captcha: '',
           spaceUU: ''
         },
+        fastLogin: {
+          mobile: '',
+          code: ''
+        },
+        activeTab: 0,
+        checked: false,
         isShowLoading: false,
         checkUsername: false,
         checkPassword: false,
@@ -193,6 +261,12 @@
         isLoginDisabled: false,
         dialogVisible: false,
         queryLink: '',
+        checkMobile: false,
+        getCodeBtnIsDisabled: true,
+        sendLoginCode: true,
+        login_time: 0,
+        token: '',
+        checkCode: false,
         rules2: {
           username: [
             {validator: validateUsername, trigger: 'blur'}
@@ -200,28 +274,74 @@
           password: [
             {validator: validatePassword, trigger: 'blur'}
           ]
+        },
+        rules3: {
+          mobile: [
+            {validator: validateMobile, trigger: 'blur'}
+          ],
+          code: [
+            {validator: validateCode, trigger: 'blur'}
+          ]
         }
       }
     },
     mounted () {
       this.$nextTick(() => {
         this.getUrl()
-      })
-      this.$nextTick(() => {
-        this.getLoginStyle()
+        if (this.appId === 'mall' || this.appId === 'home') {
+          this.getCookie()
+        }
+        this.validUserName()
       })
     },
     computed: {
       enterprise () {
         let chooseEnterprise = this.$store.state.login.chooseRegisterEnterprise.choose.data
         return chooseEnterprise
+      },
+      loginStyle () {
+        return this.$store.state.login.loginStyle.data.content ? this.$store.state.login.loginStyle.data.content : ''
       }
-      // loginUrl () {
-      //   console.log(this.$store.state.login.loginStyle.loginStyle.data)
-      //   return this.$store.state.login.loginStyle.loginStyle.data
-      // }
     },
     methods: {
+      // 获取用户错误次数
+      validUserName () {
+        if (this.login.username) {
+          //    获取密码输错次数
+          this.$http.get(`/sso/login/getPwdErrorCount`, {params: {username: this.login.username}})
+            .then(response => {
+              if (response.data.success) {
+                let getPasswordErrorCount = response.data.content || ''
+                if (getPasswordErrorCount >= 5) {
+                  this.$message.error('密码错误次数已达上限,今日无法登陆')
+                  this.isLoginDisabled = true
+                  this.showCheckCode = false
+                } else if (getPasswordErrorCount < 3) {
+                  this.isLoginDisabled = false
+                  this.checkUsername = true
+                  this.showCheckCode = false
+                } else if (getPasswordErrorCount >= 3 && getPasswordErrorCount < 5) {
+                  if (getPasswordErrorCount === 3) {
+                    this.$message.error('当前已输错密码3次,若达到5次今日将无法登陆')
+                  }
+                  if (getPasswordErrorCount === 4) {
+                    this.$message.error('当前已输错密码4次,若达到5次今日将无法登陆')
+                  }
+                  this.isLoginDisabled = false
+                  this.checkUsername = true
+                  this.showCheckCode = true
+                } else {
+                  this.checkUsername = false
+                  this.showCheckCode = false
+                }
+              } else {
+                return Promise.reject(response.data)
+              }
+            }).catch(err => {
+              this.$message.error(err.errMsg)
+            })
+        }
+      },
       // 更换管理员
       changeManage () {
         window.location.href = `appeals/changeManagerAppeal${this.$store.state.option.fullPath}`
@@ -242,52 +362,13 @@
         this.returnUrl = request['returnURL'] || ''
         this.baseUrl = request['baseUrl'] || ''
       },
-      // 获取后台返回的数据
-      getLoginStyle () {
-        this.$http.get(`/sso/login/page/style`, {params: {appId: this.appId}})
-          .then(response => {
-            if (response.data.success) {
-              let logoUrlStyle = response.data.content.logoUrl
-              let bgUrl = response.data.content.bgUrl
-              let bgColor = response.data.content.bgColor
-              let bgLink = response.data.content.bgLink
-              let title = response.data.content.title || '欢迎登录'
-              let appId = response.data.content.appId
-              let nb = document.getElementById('navbar-brand')
-              nb.style.backgroundImage = 'url(' + logoUrlStyle + ')'
-              nb.innerHTML = title
-              if (appId === 'mall') {
-                nb.href = 'https://www.usoftmall.com/'
-              }
-              let bg = document.getElementById('bgStyle')
-              bg.style.backgroundImage = 'url(' + bgUrl + ')'
-              bg.style.backgroundColor = bgColor
-              if (bgLink) {
-                bg.onclick = function () {
-                  window.location.href = bgLink
-                }
-              }
-            } else {
-              return Promise.reject(response.data)
-            }
-          }).catch(err => {
-            // console.log(err)
-            this.$message.error(err.errMsg)
-          })
-      },
-//      忘记密码
       goForgetPassword () {
         let url = `/reset/forgetPasswordValidationAccount?${this.queryLink}`
         document.getElementById('forget').href = url
       },
 //      去注册
       goRegister () {
-        if (this.appId === 'mall') {
-          var registerurl = `/register/personalRegistration?${this.queryLink}`
-        } else {
-          registerurl = `/register/enterpriseRegistration?${this.queryLink}`
-        }
-        document.getElementById('register').href = registerurl
+        document.getElementById('register').href = `/register/enterpriseRegistration?${this.queryLink}`
       },
   //    获取验证码
       getCode () {
@@ -328,18 +409,26 @@
                   let param = response.data.content.data
                   let a = ''
                   for (let n in param) {
-                    a += (n + '=' + param[n] + '&')
+                    a += (n + '=' + encodeURIComponent(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, data) {
-                      if (err) throw err
-                      console.log(data)
+                  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.isShowLoading = true
-                  setTimeout(function () {
-                    window.location.href = response.data.content.returnUrl || 'http://www.ubtob.com'
-                  }, 3000)
                 }
               } else {
                 this.$message.error(response.data)
@@ -374,12 +463,194 @@
       chooseOneEnterprise (flag, spaceUU) {
         this.login.spaceUU = spaceUU
         this.dialogVisible = false
-        this.isLogin(flag)
+        if (this.activeTab === 0) {
+          this.isLogin(flag)
+        } else if (this.activeTab === 1) {
+          this.fastToLogin(flag)
+        }
+        if (this.appId === 'mall' || this.appId === 'home') {
+          if (this.checked) {
+            this.setCookie(this.login.username, this.login.password, 7)
+          } else {
+            this.clearCookie()
+          }
+        }
+      },
+      // 短信快捷登录
+      fastToLogin (flag) {
+        this.isShowLoading = true
+        if (!this.fastLogin.mobile) {
+          this.isShowLoading = false
+          this.$message.error('请填写手机号')
+        } else {
+          let param = new FormData()
+          param.append('mobile', this.fastLogin.mobile)
+          param.append('code', this.fastLogin.code)
+          param.append('appId', this.appId)
+          param.append('token', this.token)
+          param.append('spaceUU', this.login.spaceUU)
+          param.append('returnUrl', this.returnUrl)
+          param.append('baseUrl', this.baseUrl)
+          let config = {
+            headers: {'Content-Type': 'multipart/form-data'}
+          }
+          this.$http.post('/sso/login/sms', param, config)
+            .then(response => {
+              this.isShowLoading = false
+              if (response.data.success) {
+                if (response.data.content.spaces) {
+//                   弹框让用户选择企业
+                  this.$store.commit('login/chooseRegisterEnterprise/GET_ENTERPRISE_SUCCESS', response.data.content.spaces)
+                  this.dialogVisible = flag
+                } else if (response.data.content.loginUrls) {
+//                  遍历登录url循环让各应用登录(需要跨域)
+                  let param = response.data.content.data
+                  let a = ''
+                  for (let n in param) {
+                    a += (n + '=' + encodeURIComponent(param[n]) + '&')
+                  }
+                  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)
+                  }
+                }
+              } else {
+                this.$message.error(response.data)
+                return Promise.reject(response.data)
+              }
+            }).catch(err => {
+              this.isShowLoading = false
+              let _this = this
+              setTimeout(function () {
+                _this.getCode()
+              }, 100)
+              this.$message.error(err.errMsg)
+            })
+        }
+      },
+      getJsonp: function (url, timeout = 500) {
+        return new Promise((resolve, reject) => {
+          this.$jsonp(url, {
+            name: 'successCallback',
+            timeout: timeout
+          }, function (err, data) {
+            if (err) {
+              reject(err)
+              throw err
+            } else {
+              resolve(data)
+            }
+          })
+        })
+      },
+      crossAfter (url) {
+        try {
+          window.location.href = url
+        } catch (err) {
+          console.log(err)
+        }
+      },
+      loginOther (response, a, timeout) {
+        const crossAfter = this.crossAfter
+        let promises = []
+        for (let i in response.data.content.loginUrls) {
+          promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
+        }
+        Promise.all(promises).then(() => {
+          crossAfter(response.data.content.returnUrl || 'http://www.ubtob.com', timeout)
+        }).catch(() => {
+          crossAfter(response.data.content.returnUrl || 'http://www.ubtob.com', timeout)
+        })
+      },
+      // 设置cookie
+      setCookie (cName, cPwd, exdays) {
+        let exdate = new Date()
+        exdate.setTime(exdate.getTime() + 24 * 60 * 60 * 1000 * exdays)
+        window.document.cookie = 'userName' + '=' + cName + ';path=/;expires=' + exdate.toGMTString()
+        window.document.cookie = 'userPwd' + '=' + cPwd + ';path=/;expires=' + exdate.toGMTString()
+      },
+      // 读取cookies
+      getCookie () {
+        if (document.cookie.length > 0) {
+          let arr = document.cookie.split(';')
+          for (var i = 0; i < arr.length; i++) {
+            let arr2 = arr[i].split('=')
+            if (arr2[0].trim() === 'userName') {
+              this.login.username = arr2[1]
+            }
+            if (arr2[0].trim() === 'userPwd') {
+              this.login.password = arr2[1]
+            }
+            if (this.login.username && this.login.username) {
+              this.checked = true
+            }
+          }
+        }
+      },
+      // 清除cookie
+      clearCookie () {
+        this.setCookie('', '', -1)
+      },
+      // 获取校验码
+      getCheckCode () {
+        this.isShowLoading = true
+        if (!this.fastLogin.mobile) {
+          this.isShowLoading = false
+          this.$message.error('请先填写手机号')
+        } else {
+          if (this.checkMobile) {
+            this.$http.get(`/sso/login/sendSmsCode`, {params: {mobile: this.fastLogin.mobile}})
+              .then(response => {
+                this.isShowLoading = false
+                if (response.data) {
+                  if (response.data.success) {
+                    this.token = response.data.content.token
+                    this.$message({
+                      message: '验证码已经发送到您的手机,请注意查收',
+                      type: 'success'
+                    })
+                    this.sendLoginCode = false
+                    this.login_time = 60
+                    var loginTime = setInterval(() => {
+                      this.login_time--
+                      if (this.login_time <= 0) {
+                        this.sendLoginCode = true
+                        clearInterval(loginTime)
+                      }
+                    }, 1000)
+                  } else {
+                    this.$message.error(response.data.errMsg)
+                  }
+                } else {
+                  return Promise.reject(response.data)
+                }
+              }).catch(err => {
+                this.isShowLoading = false
+                this.$message.error(err.errMsg)
+              })
+          } else {
+            this.isShowLoading = false
+          }
+        }
       }
     }
   }
 </script>
-<style lang="scss" scoped type="text/scss">
+<style lang="scss" type="text/scss" scoped>
   @import '~assets/scss/mixins';
   @import '~assets/scss/variables';
   .x-navbar{
@@ -389,15 +660,30 @@
   .container{
     position: relative;
     width: 990px!important;
+    height: 80px;
+    .navbar-header{
+      height: 80px;
+      line-height: 80px;
+    }
   a.navbar-brand{
-    padding: 0 0 0 85px;
+    overflow: hidden;
+    padding: 0px;
     height: inherit;
     line-height: inherit;
     font-family: "\5FAE\8F6F\96C5\9ED1";
     font-size: 24px;
     font-weight: 400;
     color: #888;
-    background: url(/images/all/icon_brand.png) left center no-repeat;
+    img{
+      margin: 28px 8px 0 0;
+      max-width: 80px;
+      max-height: 27px;
+      vertical-align: middle;
+      float: left;
+    }
+    span{
+      float: left;
+    }
   }
   .collapse{
   a{
@@ -420,6 +706,7 @@
       text-align: right;
       margin-top: 7px;
       a{
+        font-size: 12px;
         color: #2d8cf0;
         background: 0 0;
         text-decoration: none;
@@ -429,7 +716,12 @@
       }
       a.first{
         float: left;
-        margin-top: 3px;
+        margin-top: 2px;
+        font-size: 12px;
+      }
+      a.change{
+        margin:2px 0 0 50px;
+        float: left;
         font-size: 12px;
       }
     }
@@ -469,6 +761,9 @@
             display:inline-block;
             padding: 10px 20px;
             width: 33%;
+            overflow: hidden;
+            white-space: nowrap;
+            text-overflow: ellipsis;
             height: 42px;
             line-height: 21px;
             font-size: 12px;
@@ -503,7 +798,9 @@
         li{
           width: 100%;
           height: 475px;
-          background: url(/images/all/banner.jpg) center center / auto 100% no-repeat rgb(202, 202, 214);
+          .inner{
+            height: 100%;
+          }
         }
       }
     }
@@ -569,7 +866,7 @@
           }
           i.fa-arrow-circle-o-right{
             margin-right: 5px;
-            font-size: 14px;
+            font-size: 12px;
             color: #5078cb;
           }
           .warn-text-area{
@@ -577,6 +874,24 @@
             font-size: 13px;
             color: #000;
           }
+          .text-position {
+            overflow: hidden;
+            .page-part {
+              float: left;
+              margin-bottom: 0;
+              .el-checkbox {
+                margin: 0;
+                span.el-checkbox__inner{
+                  width: 14px;
+                  height: 14px;
+                }
+              }
+            }
+            .forget {
+              float: right;
+              color: #2d8cf0;
+            }
+          }
         }
         .x-login-qrcode{
           display: none;
@@ -584,4 +899,7 @@
       }
     }
   }
+  .footer{
+    padding: 50px 0;
+  }
 </style>

+ 10 - 2
components/mobile/footerMobile.vue

@@ -1,13 +1,21 @@
 <template>
 <div class="footer">
   <span>已有账户?</span>&nbsp;&nbsp;
-  <a href="/">立即登录</a>
+  <a :href="returnLogin">立即登录</a>
 </div>
 </template>
 
 <script>
   export default {
-    name: 'footerMobile'
+    name: 'footerMobile',
+    data () {
+      return {
+        returnLogin: ''
+      }
+    },
+    mounted () {
+      this.returnLogin = window.location.origin + window.location.search
+    }
   }
 </script>
 

+ 57 - 14
components/mobile/loginMobile.vue

@@ -1,7 +1,7 @@
 <template>
 <div class="login">
   <div class="page-part">
-    <mt-field auto-complete="off" placeholder="手机号/邮箱/账号ID" v-model="login.username" @blur.native.capture="codeCount"></mt-field>
+    <mt-field auto-complete="off" placeholder="手机号/邮箱" v-model="login.username" @blur.native.capture="codeCount"></mt-field>
   </div>
   <div class="page-part">
     <mt-field placeholder="密码" v-model="login.password" type="password"></mt-field>
@@ -73,11 +73,7 @@
         window.location.href = `/reset/forgetPasswordValidationAccount${this.$store.state.option.fullPath}`
       },
       jump () {
-        if (this.appId === 'mall') {
-          window.location.href = `/register/personalRegistration${this.$store.state.option.fullPath}`
-        } else {
-          window.location.href = `/register/enterpriseRegistration${this.$store.state.option.fullPath}`
-        }
+        window.location.href = `/register/enterpriseRegistration${this.$store.state.option.fullPath}`
       },
       getUrl () {
         this.appId = this.$store.state.option.appId
@@ -153,17 +149,30 @@
                 let param = response.data.content.data
                 let a = ''
                 for (let n in param) {
-                  a += (n + '=' + param[n] + '&')
+                  a += (n + '=' + encodeURIComponent(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
+                let params = a.substr(0, a.length - 1)
+                this.$indicator.open('跳转中...')
+                if (response.data.content.currentUrl) {
+                  this.$jsonp(`${response.data.content.currentUrl}?${params}`, {
+                    name: 'successCallback',
+                    timeout: 5000
+                  }, (err, data) => {
+                    if (err) {
+                      this.$indicator.close()
+                      this.$toast({
+                        message: '登录超时,请重试',
+                        iconClass: 'el-icon-error'
+                      })
+                      this.login.spaceUU = ''
+                      throw err
+                    } else {
+                      this.loginOther(response, params)
+                    }
                   })
+                } else {
+                  this.loginOther(response, params, 3000)
                 }
-                this.$indicator.open('跳转中...')
-                setTimeout(function () {
-                  window.location.href = response.data.content.returnUrl || 'http://www.ubtob.com'
-                }, 3000)
               }
             } else {
               this.login.password = ''
@@ -191,6 +200,40 @@
               iconClass: 'el-icon-error'
             })
           })
+      },
+      getJsonp: function (url, timeout = 500) {
+        return new Promise((resolve, reject) => {
+          this.$jsonp(url, {
+            name: 'successCallback',
+            timeout: timeout
+          }, function (err, data) {
+            if (err) {
+              reject(err)
+              throw err
+            } else {
+              resolve(data)
+            }
+          })
+        })
+      },
+      crossAfter (url) {
+        try {
+          window.location.href = url
+        } catch (err) {
+          console.log(err)
+        }
+      },
+      loginOther (response, a, timeout) {
+        const crossAfter = this.crossAfter
+        let promises = []
+        for (let i in response.data.content.loginUrls) {
+          promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
+        }
+        Promise.all(promises).then(() => {
+          crossAfter(response.data.content.returnUrl || 'http://www.ubtob.com', timeout)
+        }).catch(() => {
+          crossAfter(response.data.content.returnUrl || 'http://www.ubtob.com', timeout)
+        })
       }
     }
   }

+ 77 - 6
components/mobile/registerEnterprise/index.vue

@@ -383,16 +383,26 @@
       // 验证邮箱
       validateEmail () {
         let reg = /^([\w-])+(\.\w+)*@([\w-])+((\.\w{2,3}){1,3})$/
-        if (!this.step2.email) {
-          this.downToast('请填写联系邮箱信息')
-          this.state.email = 'error'
-        } else {
+        if (this.step2.email) {
           if (!reg.test(this.step2.email)) {
             this.downToast('请输入正确的邮箱地址格式')
             this.state.email = 'warning'
           } else {
-            this.state.email = 'success'
+            this.$http.get('/api/user/checkEmail', {params: {email: this.step2.email}})
+              .then(response => {
+                if (response.data.hasRegister) {
+                  this.state.email = 'warning'
+                  this.downToast('该邮箱已被注册')
+                } else {
+                  this.state.email = 'success'
+                }
+              }).catch(() => {
+                this.downToast('请检查网络是否正常或联系服务商')
+              })
           }
+        } else {
+          this.downToast('请填写联系邮箱信息')
+          this.state.email = 'error'
         }
       },
       // 注册请求方法
@@ -415,7 +425,33 @@
           .then(response => {
             this.$indicator.close()
             if (response.data.success) {
-              window.location.href = '/overRegister/overEnterprise'
+              if (response.data.content) {
+                let param = response.data.content.data
+                let a = ''
+                for (let n in param) {
+                  a += (n + '=' + encodeURIComponent(param[n]) + '&')
+                }
+                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)
+                }
+              } else {
+                window.location.href = '/overRegister/overEnterprise'
+              }
             } else {
               this.downToast(response.data.errMsg)
             }
@@ -457,6 +493,41 @@
             }
           }
         }
+      },
+      getJsonp: function (url, timeout = 500) {
+        return new Promise((resolve, reject) => {
+          this.$jsonp(url, {
+            name: 'successCallback',
+            timeout: timeout
+          }, function (err, data) {
+            if (err) {
+              reject(err)
+              throw err
+            } else {
+              resolve(data)
+            }
+          })
+        })
+      },
+      crossAfter (url) {
+        try {
+          window.location.href = url
+        } catch (err) {
+          console.log(err)
+        }
+      },
+      loginOther (response, a, timeout) {
+        const crossAfter = this.crossAfter
+        let promises = []
+        for (let i in response.data.content.loginUrls) {
+          promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
+        }
+        let returnUrl = decodeURIComponent(this.$route.query.returnURL)
+        Promise.all(promises).then(() => {
+          crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
+        }).catch(() => {
+          crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
+        })
       }
     }
   }

+ 63 - 2
components/mobile/registerPersonal/index.vue

@@ -274,8 +274,34 @@
             .then(response => {
               this.$indicator.close()
               if (response.data.success) {
-                let userUU = response.data.content.userUU
-                window.location.href = `/overRegister/${userUU}`
+                if (response.data.content.data) {
+                  let param = response.data.content.data
+                  let a = ''
+                  for (let n in param) {
+                    a += (n + '=' + encodeURIComponent(param[n]) + '&')
+                  }
+                  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)
+                  }
+                } else {
+                  let userUU = response.data.content.userUU
+                  window.location.href = `/overRegister/${userUU}`
+                }
               } else if (response.data.error) {
                 this.$toast({
                   message: response.data.errMsg,
@@ -287,6 +313,41 @@
               this.downToast('请检查网络是否正常或联系服务商')
             })
         }
+      },
+      getJsonp: function (url, timeout = 500) {
+        return new Promise((resolve, reject) => {
+          this.$jsonp(url, {
+            name: 'successCallback',
+            timeout: timeout
+          }, function (err, data) {
+            if (err) {
+              reject(err)
+              throw err
+            } else {
+              resolve(data)
+            }
+          })
+        })
+      },
+      crossAfter (url) {
+        try {
+          window.location.href = url
+        } catch (err) {
+          console.log(err)
+        }
+      },
+      loginOther (response, a, timeout) {
+        const crossAfter = this.crossAfter
+        let promises = []
+        for (let i in response.data.content.loginUrls) {
+          promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
+        }
+        let returnUrl = decodeURIComponent(this.$route.query.returnURL)
+        Promise.all(promises).then(() => {
+          crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
+        }).catch(() => {
+          crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
+        })
       }
     }
   }

+ 5 - 1
components/mobile/reset/stepLast.vue

@@ -38,7 +38,11 @@
     },
     methods: {
       sureAccount () {
-        this.$router.push('/')
+        if (this.$route.query.source === 'UU') {
+          window.location.href = 'http://sureCloseWeb.com'
+        } else {
+          this.$router.push('/')
+        }
       }
     }
   }

+ 74 - 0
components/register/CityRegisterOver.vue

@@ -0,0 +1,74 @@
+<template>
+  <div>
+    <div class="city">
+      <div class="container">
+        <div class="bgImg" v-bind:style="{ background: `url(${loginStyle.rebgUrl}) center center/100% 100% no-repeat #417294` }">
+          <div class="go">
+            <div class="content">
+              <img src="/images/all/success.png" alt=""/> 恭喜您注册完成!
+            </div>
+            <a :href="(loginStyle && loginStyle.returnHomeUrl) ? JSON.parse(loginStyle.returnHomeUrl).url : ''" class="btn">跳转至产城门户</a>
+          </div>
+        </div>
+      </div>
+    </div>
+    <template>
+      <div v-html="loginStyle.footUrl" class="footer"></div>
+    </template>
+  </div>
+</template>
+<script>
+  export default {
+    name: 'city',
+    computed: {
+      loginStyle () {
+        console.log(this.$store.state.login.loginStyle.data.content)
+        return this.$store.state.login.loginStyle.data.content ? this.$store.state.login.loginStyle.data.content : ''
+      }
+    }
+  }
+</script>
+<style scoped type="text/scss" lang="scss">
+  .city{
+    margin: 0 auto;
+    text-align: center;
+    .container {
+      width: 100%;
+      .bgImg {
+        padding-top: 120px;
+        width: 100%;
+        min-height: 670px;
+        .go {
+          margin: 0 auto;
+          width: 395px;
+          height: 205px;
+          text-align: center;
+          border-radius: 24px;
+          background: rgba(255, 255, 255, 0.7);
+          .content {
+            padding-top: 25px;
+            font-size: 28px;
+            color: #000;
+            letter-spacing: 1.43px;
+            img {
+              margin-right: 33px;
+            }
+          }
+        }
+      }
+    }
+    .btn{
+      margin-top: 39px;
+      display: inline-block;
+      width: 240px;
+      height: 46px;
+      line-height: 46px;
+      font-size: 22px;
+      color: #fff;
+      background: #237594;
+    }
+  }
+  .footer{
+    padding: 50px 0;
+  }
+</style>

+ 326 - 138
components/register/EnterpriseRegistration.vue

@@ -27,12 +27,12 @@
             </el-form-item>
             <el-form-item>
               <a class="btn finish"
-                 @click="checkPhone"
-                 :disabled="!this.checked || !this.mobileChecked || !this.codeChecked">验证手机</a>
+                 @click="checkPhone">下一步</a>
             </el-form-item>
             <el-form-item>
               <el-checkbox name="type" v-model="checked" @click="checkboxIsChecked"></el-checkbox>
-              <span class="agree">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
+              <span class="agree" v-if="!agreementUrl || (agreementUrl && (JSON.parse(agreementUrl.terms).isUrl))">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
+              <span class="agree" v-else>我已阅读并同意<a :href="`/common/cityAgreement/?appId=${this.$route.query.appId}`">《{{JSON.parse(agreementUrl.terms).name || ''}}》</a></span>
             </el-form-item>
           </el-form>
         </div>
@@ -46,13 +46,15 @@
                         placeholder="企业名称"
               ></el-input>
               <span class="tip exist" v-show="isSpaceNameExist">
-                {{spaceNameExitMsg}} <i class="fa fa-question-circle" aria-hidden="true"
-                                       v-show="spaceNameExitMsg != '出现异常'"
-                                       @mouseenter='showPopTip =true'
-                                       @mouseleave='showPopTip = false'></i>
+                {{spaceNameExitMsg}}
+                <!--<i class="fa fa-question-circle" aria-hidden="true"-->
+                                       <!--v-show="spaceNameExitMsg != '出现异常'"-->
+                                       <!--@mouseenter='showPopTip =true'-->
+                                       <!--@mouseleave='showPopTip = false'></i>-->
               </span>
-              <div class="pop-tip"  @mouseenter='showPopTip =true'
-                   @mouseleave='showPopTip = false'> <span class='pop-title' v-show="showPopTip">如果您所属企业的管理员已离职或不再使用优软云,请 <a href="/appeals/changeManagerAppeal">更换管理员</a> </span></div>
+              <!--<div class="pop-tip"  @mouseenter='showPopTip =true'-->
+                   <!--@mouseleave='showPopTip = false'> <span class='pop-title' v-show="showPopTip">如果您所属企业的管理员已离职或不再使用优软云,请 <a href="/appeals/changeManagerAppeal">更换管理员</a> </span>-->
+              <!--</div>-->
             </el-form-item>
             <el-form-item prop="businessCode">
               <el-input type="text"
@@ -66,7 +68,7 @@
               <el-input type="text" v-model="enterprise1.vipName" auto-complete="off" placeholder="管理员姓名"></el-input>
             </el-form-item>
             <el-form-item prop="password" v-if="!isHasRegister">
-              <el-input type="password" v-model="enterprise1.password" auto-complete="off" placeholder="登录密码"></el-input>
+              <el-input type="password" v-model="enterprise1.password" auto-complete="new-password" placeholder="登录密码"></el-input>
               <div class="pwd sm" v-show="showMsgTip1">密码强度 <em></em><em></em><em></em><span>弱</span></div>
               <div class="pwd md" v-show="showMsgTip2">密码强度 <em></em><em></em><em></em><span>中</span></div>
               <div class="pwd lar" v-show="showMsgTip3">密码强度 <em></em><em></em><em></em><span>强</span></div>
@@ -75,14 +77,14 @@
             <el-form-item prop="password" v-if="isHasRegister">
               <el-input type="password"
                         v-model="enterprise1.password"
-                        auto-complete="off"
+                        auto-complete="new-password"
                         placeholder="密码确认"
                         v-bind:class="{ correct: passwordChecked }"></el-input>
-              <span class="sure" v-if="isHasRegister" v-show="phoneIsRegisterTip">手机号已注册,请输入原密码 <a href="/reset/ForgetPasswordValidationAccount">忘记密码?</a></span>
+              <span class="sure" v-if="isHasRegister" v-show="phoneIsRegisterTip">该手机号已有优软账号,请输入原账号的登录密码进行校验确认</span>
             </el-form-item>
             <el-form-item prop="confirm" v-if="!isHasRegister">
               <el-input type="password"
-                        auto-complete="off"
+                        auto-complete="new-password"
                         placeholder="密码确认"
                         v-bind:class="{active: showPasswordError}"
                         v-model="enterprise1.confirm"></el-input>
@@ -96,22 +98,22 @@
                         v-bind:class="{active: emailHasRegister}"></el-input>
               <span class="codeError-tip" v-if="emailHasRegister">该邮箱已被注册</span>
             </el-form-item>
-              <a class="btn finish"
-                 :disabled="!isHasRegister ? !spaceNameChecked || !businessCodeChecked || !vipNameChecked || !passwordChecked || !passwordConfirmChecked || !emailChecked || !checked : !isHasEmail ? !spaceNameChecked || !businessCodeChecked || !passwordChecked || !emailChecked || !checked : !spaceNameChecked || !businessCodeChecked || !passwordChecked || !checked"
-                 @click="sureRegister">确认注册
-              </a>
+              <a class="btn finish" @click="sureRegister">确认注册</a>
             </el-form-item>
 
             <el-form-item>
               <el-checkbox name="type" v-model="checked" @click="checkboxIsChecked"></el-checkbox>
-              <span class="agree">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
+              <span class="agree" v-if="!agreementUrl || (agreementUrl && (JSON.parse(agreementUrl.terms).isUrl))">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
+              <span class="agree" v-else>我已阅读并同意<a :href="`/common/cityAgreement/?appId=${this.$route.query.appId}`">《{{JSON.parse(agreementUrl.terms).name || ''}}》</a></span>
             </el-form-item>
           </el-form>
         </div>
       </div>
-      <div class="login">已有账号?<a href="/">立即登录</a></div>
+      <div class="login">已有账号?<a :href="returnLogin">立即登录</a></div>
       <loading v-show="isShowLoading"/>
     </div>
+    <!--尾部-->
+    <div v-html="loginStyle.footUrl" class="footer"></div>
   </div>
 </template>
 
@@ -153,11 +155,57 @@
           this.codeErrorChecked = false
           this.codeChecked = false
         } else {
-          if (this.enterprise.code !== '') {
-            if (this.enterprise.mobile === '') {
-              callback(new Error('请先填写正确的手机号'))
+          if (this.enterprise.mobile === '') {
+            callback(new Error('请先填写正确的手机号'))
+          } else {
+            if (this.token) {
+              if (this.enterprise.code.length === 6) {
+                let param = new FormData()
+                param.append('mobile', this.enterprise.mobile)
+                param.append('code', this.enterprise.code)
+                param.append('token', this.token)
+                let config = {
+                  headers: {'Content-Type': 'multipart/form-data'}
+                }
+                this.$http.post(`/sso/userspace/register/checkCode`, param, config)
+                  .then(response => {
+                    if (response.data.success) {
+                      this.codeChecked = true
+                      this.codeErrorChecked = false
+                    } else {
+                      this.codeErrorChecked = true
+                      this.codeChecked = false
+                      return Promise.reject(response.data)
+                    }
+                  }).catch(err => {
+                    this.codeErrorChecked = true
+                    this.codeErrorMsg = err.errMsg
+                  })
+              } else {
+                callback(new Error('请输入正确的验证码'))
+                this.codeChecked = false
+                this.codeErrorChecked = false
+              }
             } else {
-              if (this.token) {
+              callback(new Error('请先获取验证码'))
+              this.codeChecked = false
+              this.codeErrorChecked = false
+            }
+          }
+          callback()
+        }
+      }
+      var validateCodeIsEmpty = (rule, value, callback) => {
+        if (value === '') {
+          callback(new Error('请填写正确的验证码'))
+          this.codeErrorChecked = false
+          this.codeChecked = false
+        } else {
+          if (this.enterprise.mobile === '') {
+            callback(new Error('请先填写正确的手机号'))
+          } else {
+            if (this.token) {
+              if (this.enterprise.code.length === 6) {
                 let param = new FormData()
                 param.append('mobile', this.enterprise.mobile)
                 param.append('code', this.enterprise.code)
@@ -165,7 +213,7 @@
                 let config = {
                   headers: {'Content-Type': 'multipart/form-data'}
                 }
-                this.$http.post(`/sso/personal/register/checkCode`, param, config)
+                this.$http.post(`/sso/userspace/register/checkCode`, param, config)
                   .then(response => {
                     if (response.data.success) {
                       this.codeChecked = true
@@ -178,13 +226,16 @@
                   }).catch(err => {
                     this.codeErrorChecked = true
                     this.codeErrorMsg = err.errMsg
-                  // this.$message.error(err.errMsg)
                   })
               } else {
-                callback(new Error('请先获取验证码'))
+                callback(new Error('请输入正确的验证码'))
                 this.codeChecked = false
                 this.codeErrorChecked = false
               }
+            } else {
+              callback(new Error('请先获取验证码'))
+              this.codeChecked = false
+              this.codeErrorChecked = false
             }
           }
           callback()
@@ -214,7 +265,7 @@
                   }
                 }).catch(err => {
                   this.spaceNameExitMsg = err.errMsg
-//                  this.$message.error(err.errMsg)
+                  // this.$message.error(err.errMsg)
                 })
             }
           }
@@ -270,6 +321,7 @@
             if (this.enterprise1.vipName !== '') {
               if (value.length > 20) {
                 callback(new Error('输入长度过长,20个字符以内'))
+                this.vipNameChecked = false
               } else {
                 this.vipNameChecked = true
               }
@@ -375,43 +427,40 @@
           } else {
             this.passwordConfirmChecked = true
             this.showPasswordError = false
-            callback()
           }
         }
+        callback()
       }
       var validateEmail = (rule, value, callback) => {
         if (this.isHasEmail) {
           this.emailChecked = true
           this.emailHasRegister = false
         } else {
-          if (!value) {
-            callback(new Error('请填写正确的联系邮箱'))
-            this.emailChecked = false
-            this.emailHasRegister = false
-          } else {
-            if (this.enterprise1.email) {
-              var reg = /^([\w-])+(\.\w+)*@([\w-])+((\.\w{2,3}){1,3})$/
-              if (!reg.test(value)) {
-                callback(new Error('请输入正确的邮箱地址格式'))
-                this.emailChecked = false
-                this.emailHasRegister = false
-              } else {
-                this.$http.get(`/api/user/checkEmail`, {params: {email: this.enterprise1.email}})
-                  .then(response => {
-                    if (response.data.hasRegister) {
-                      this.emailChecked = false
-                      this.emailHasRegister = true
-                    } else {
-                      this.emailChecked = true
-                      this.emailHasRegister = false
-                      return Promise.reject(response.data)
-                    }
-                  }).catch(err => {
-                    this.$message.error(err.errMsg)
-                  })
-              }
+          if (this.enterprise1.email) {
+            var reg = /^([\w-])+(\.\w+)*@([\w-])+((\.\w{2,3}){1,3})$/
+            if (!reg.test(value)) {
+              callback(new Error('请输入正确的邮箱地址格式'))
+              this.emailChecked = false
+              this.emailHasRegister = false
+            } else {
+              this.$http.get(`/api/user/checkEmail`, {params: {email: this.enterprise1.email}})
+                .then(response => {
+                  if (response.data.hasRegister) {
+                    this.emailChecked = false
+                    this.emailHasRegister = true
+                  } else {
+                    this.emailChecked = true
+                    this.emailHasRegister = false
+                    return Promise.reject(response.data)
+                  }
+                }).catch(err => {
+                  this.$message.error(err.errMsg)
+                })
             }
             callback()
+          } else {
+            this.emailChecked = true
+            this.emailHasRegister = false
           }
         }
       }
@@ -453,7 +502,7 @@
         vipNameChecked: false,
         passwordChecked: false,
         passwordConfirmChecked: false,
-        emailChecked: false,
+        emailChecked: true,
         isHasRegister: false,
         isHasEmail: false,
         goNextStep: true,
@@ -463,13 +512,15 @@
         emailHasRegister: false,
         queryLink: '',
         appId: '',
+        returnLogin: '',
 //        企业注册第一步
         rules: {
           mobile: [
             {validator: validateMobile, trigger: 'blur'}
           ],
           code: [
-            {validator: validateCode, trigger: 'blur'}
+            {validator: validateCode, trigger: 'change'},
+            {validator: validateCodeIsEmpty, trigger: 'blur'}
           ]
         },
 //        企业注册第二步
@@ -491,11 +542,19 @@
             {validator: validateConfirm, trigger: 'blur'}
           ],
           email: [
-            {validator: validateEmail, trigger: 'blur'}
+            {validator: validateEmail, trigger: 'change'}
           ]
         }
       }
     },
+    computed: {
+      loginStyle () {
+        return this.$store.state.login.loginStyle.data.content
+      },
+      agreementUrl () {
+        return this.$store.state.login.agreementUrl.data.content
+      }
+    },
     mounted () {
 //      获取链接
       this.$nextTick(() => {
@@ -506,6 +565,8 @@
       // 获取链接
       getUrl () {
         var url = window.location.search
+        var origin = window.location.origin
+        this.returnLogin = origin + url
         var request = {}
         if (url.indexOf('?' !== -1)) {
           var str = url.substr(1)
@@ -591,104 +652,225 @@
             }).catch(err => {
               this.$message.error(err.errMsg)
               this.isShowLoading = false
-              // this.codeErrorChecked = true
-              // this.codeChecked = false
               this.enterprise_time = 0
             })
+        } else {
+          if (!this.enterprise.mobile) {
+            this.$message.error('手机号不能为空')
+          } else if (!this.mobileChecked) {
+            this.$message.error('手机号输入有误,请按提示重新输入')
+          } else if (!this.token) {
+            this.$message.error('请先获取验证码')
+          } else if (!this.enterprise.code) {
+            this.$message.error('验证码不能为空')
+          } else if (!this.codeChecked) {
+            this.$message.error('验证码输入有误,请按提示重新输入')
+          } else if (!this.checked) {
+            this.$message.error('您对阅读条款未做勾选')
+          }
         }
       },
 //      确认注册
       sureRegister () {
         if (!this.isHasRegister) {
           if (this.spaceNameChecked && this.businessCodeChecked && this.vipNameChecked && this.passwordChecked && this.passwordConfirmChecked && this.emailChecked && this.checked) {
-            this.isShowLoading = true
-            let param = new FormData()
-            param.append('spaceName', this.enterprise1.spaceName)
-            param.append('businessCode', this.enterprise1.businessCode)
-            param.append('vipName', this.enterprise1.vipName || '')
-            param.append('password', this.enterprise1.password)
-            param.append('email', this.enterprise1.email || '')
-            param.append('appId', this.$store.state.option.appId)
-            param.append('inviteSpaceUU', this.$store.state.option.inviteSpaceUU)
-            param.append('inviteUserUU', this.$store.state.option.inviteUserUU)
-            param.append('invitationTime', this.$store.state.option.invitationTime)
-            let config = {
-              headers: {'Content-Type': 'multipart/form-data'}
+            this.submitRegister()
+          } else {
+            if (!this.enterprise1.spaceName) {
+              this.$message.error('企业名不能为空')
+            } else if (!this.spaceNameChecked) {
+              this.$message.error('企业名称输入有误,请按提示重新输入')
+            } else if (!this.enterprise1.businessCode) {
+              this.$message.error('营业执照号不能为空')
+            } else if (!this.businessCodeChecked) {
+              this.$message.error('营业执照号输入有误,请按提示重新输入')
+            } else if (!this.enterprise1.vipName) {
+              this.$message.error('管理员姓名不能为空')
+            } else if (!this.vipNameChecked) {
+              this.$message.error('管理员姓名输入有误,请按提示重新输入')
+            } else if (!this.enterprise1.password) {
+              this.$message.error('密码不能为空')
+            } else if (!this.passwordChecked) {
+              this.$message.error('密码输入有误,请按提示重新输入')
+            } else if (!this.enterprise1.confirm) {
+              this.$message.error('请再次输入密码')
+            } else if (this.enterprise1.password !== this.enterprise1.confirm) {
+              this.$message.error('请确认两次填写密码是否一致')
+            } else if (this.enterprise1.email && !this.emailChecked) {
+              this.$message.error('邮箱输入有误,请按提示重新输入')
+            } else if (!this.checked) {
+              this.$message.error('您对阅读条款未做勾选')
             }
-            this.$http.post('/sso/userspace/register', param, config)
-              .then(response => {
-                this.isShowLoading = false
-                if (response.data.success) {
-                  window.location.href = '/overRegister/overEnterprise'
-                } else {
-                  return Promise.reject(response.data)
-                }
-              }).catch(err => {
-                this.isShowLoading = false
-                this.$message.error(err.errMsg)
-              })
           }
         } else {
           if (this.isHasEmail) {
-            if (this.spaceNameChecked && this.businessCodeChecked && this.passwordChecked) {
-              this.isShowLoading = true
-              let param = new FormData()
-              param.append('spaceName', this.enterprise1.spaceName)
-              param.append('businessCode', this.enterprise1.businessCode)
-              param.append('vipName', this.enterprise1.vipName || '')
-              param.append('password', this.enterprise1.password)
-              param.append('email', this.enterprise1.email || '')
-              param.append('appId', this.$store.state.option.appId)
-              param.append('inviteSpaceUU', this.$store.state.option.inviteSpaceUU)
-              param.append('inviteUserUU', this.$store.state.option.inviteUserUU)
-              param.append('invitationTime', this.$store.state.option.invitationTime)
-              let config = {
-                headers: {'Content-Type': 'multipart/form-data'}
-              }
-              this.$http.post('/sso/userspace/register', param, config)
-                .then(response => {
-                  this.isShowLoading = false
-                  if (response.data.success) {
-                    window.location.href = '/overRegister/overEnterprise'
-                  } else {
-                    return Promise.reject(response.data)
-                  }
-                }).catch(err => {
-                  this.isShowLoading = false
-                  this.$message.error(err.errMsg)
-                })
+            if (this.spaceNameChecked && this.businessCodeChecked && this.passwordChecked && this.checked) {
+              this.submitRegister()
+            } else {
+              if (!this.enterprise1.spaceName) {
+                this.$message.error('企业名不能为空')
+              } else if (!this.spaceNameChecked) {
+                this.$message.error('企业名称输入有误,请按提示重新输入')
+              } else if (!this.enterprise1.businessCode) {
+                this.$message.error('营业执照号不能为空')
+              } else if (!this.businessCodeChecked) {
+                this.$message.error('营业执照号输入有误,请按提示重新输入')
+              } else if (!this.enterprise1.password) {
+                this.$message.error('密码不能为空')
+              } else if (!this.checked) {
+                this.$message.error('您对阅读条款未做勾选')
+              }
             }
           } else {
-            if (this.spaceNameChecked && this.businessCodeChecked && this.passwordChecked && this.emailChecked) {
-              this.isShowLoading = true
-              let param = new FormData()
-              param.append('spaceName', this.enterprise1.spaceName)
-              param.append('businessCode', this.enterprise1.businessCode)
-              param.append('vipName', this.enterprise1.vipName || '')
-              param.append('password', this.enterprise1.password)
-              param.append('email', this.enterprise1.email || '')
-              param.append('appId', this.$store.state.option.appId)
-              param.append('inviteSpaceUU', this.$store.state.option.inviteSpaceUU)
-              param.append('inviteUserUU', this.$store.state.option.inviteUserUU)
-              param.append('invitationTime', this.$store.state.option.invitationTime)
-              let config = {
-                headers: {'Content-Type': 'multipart/form-data'}
-              }
-              this.$http.post('/sso/userspace/register', param, config)
-                .then(response => {
-                  this.isShowLoading = false
-                  if (response.data.success) {
-                    window.location.href = '/overRegister/overEnterprise'
+            if (this.spaceNameChecked && this.businessCodeChecked && this.passwordChecked && this.emailChecked && this.checked) {
+              this.submitRegister()
+            } else {
+              if (!this.enterprise1.spaceName) {
+                this.$message.error('企业名不能为空')
+              } else if (!this.spaceNameChecked) {
+                this.$message.error('企业名称输入有误,请按提示重新输入')
+              } else if (!this.enterprise1.businessCode) {
+                this.$message.error('营业执照号不能为空')
+              } else if (!this.businessCodeChecked) {
+                this.$message.error('营业执照号输入有误,请按提示重新输入')
+              } else if (!this.enterprise1.password) {
+                this.$message.error('密码不能为空')
+              } else if (this.enterprise1.email && !this.emailChecked) {
+                this.$message.error('邮箱输入有误,请按提示重新输入')
+              } else if (!this.checked) {
+                this.$message.error('您对阅读条款未做勾选')
+              }
+            }
+          }
+        }
+      },
+      submitRegister () {
+        this.isShowLoading = true
+        let param = new FormData()
+        param.append('spaceName', this.enterprise1.spaceName)
+        param.append('businessCode', this.enterprise1.businessCode)
+        param.append('vipName', this.enterprise1.vipName || '')
+        param.append('password', this.enterprise1.password)
+        param.append('email', this.enterprise1.email || '')
+        param.append('appId', this.$store.state.option.appId)
+        param.append('inviteSpaceUU', this.$store.state.option.inviteSpaceUU)
+        param.append('inviteUserUU', this.$store.state.option.inviteUserUU)
+        param.append('invitationTime', this.$store.state.option.invitationTime)
+        let config = {
+          headers: {'Content-Type': 'multipart/form-data'}
+        }
+        this.$http.post('/sso/userspace/register', param, config)
+          .then(response => {
+            this.isShowLoading = false
+            if (response.data.success) {
+              console.log(response.data)
+              if (response.data.content) {
+                if (response.data.content.type === 'mall') {
+                  let param = response.data.content.data
+                  let a = ''
+                  for (let n in param) {
+                    a += (n + '=' + encodeURIComponent(param[n]) + '&')
+                  }
+                  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 {
-                    return Promise.reject(response.data)
+                    this.loginOther(response, params, 3000)
                   }
-                }).catch(err => {
-                  this.isShowLoading = false
-                  this.$message.error(err.errMsg)
-                })
+                } else if (response.data.content.type === 'city') {
+                  let param = response.data.content.data
+                  let a = ''
+                  for (let n in param) {
+                    a += (n + '=' + encodeURIComponent(param[n]) + '&')
+                  }
+                  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.loginCityOther(response, params)
+                      }
+                    })
+                  } else {
+                    this.loginCityOther(response, params, 3000)
+                  }
+                }
+              } else {
+                window.location.href = '/overRegister/overEnterprise'
+              }
+            } else {
+              return Promise.reject(response.data)
             }
-          }
+          }).catch(err => {
+            this.isShowLoading = false
+            this.$message.error(err.errMsg)
+          })
+      },
+      getJsonp: function (url, timeout = 500) {
+        return new Promise((resolve, reject) => {
+          this.$jsonp(url, {
+            name: 'successCallback',
+            timeout: timeout
+          }, function (err, data) {
+            if (err) {
+              reject(err)
+              throw err
+            } else {
+              resolve(data)
+            }
+          })
+        })
+      },
+      crossAfter (url) {
+        try {
+          window.location.href = url
+        } catch (err) {
+          console.log(err)
         }
+      },
+      loginOther (response, a, timeout) {
+        const crossAfter = this.crossAfter
+        let promises = []
+        for (let i in response.data.content.loginUrls) {
+          promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
+        }
+        let returnUrl = decodeURIComponent(this.$route.query.returnURL)
+        Promise.all(promises).then(() => {
+          crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
+        }).catch(() => {
+          crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
+        })
+      },
+      loginCityOther (response, a, timeout) {
+        const crossAfter = this.crossAfter
+        let promises = []
+        for (let i in response.data.content.loginUrls) {
+          promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
+        }
+        Promise.all(promises).then(() => {
+          crossAfter('/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath || '/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath, timeout)
+        }).catch(() => {
+          crossAfter('/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath || '/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath, timeout)
+        })
       }
     }
   }
@@ -735,7 +917,10 @@
               span.sure{
                 position: absolute;
                 top: 0;
-                right: -240px;
+                right: -271px;
+                width: 250px;
+                text-align: left;
+                line-height: 21px;
                 font-size: 13px;
                 color: #8c8c8c;
               }
@@ -934,4 +1119,7 @@
             }
     }
   }
+  .footer{
+    padding: 50px 0;
+  }
 </style>

+ 235 - 41
components/register/PersonalRegistration.vue

@@ -12,7 +12,7 @@
               <el-input type="text" v-model="item.vipName" auto-complete="off" placeholder="会员名"></el-input>
             </el-form-item>
             <el-form-item prop="password">
-              <el-input type="password" v-model="item.password" auto-complete="off" placeholder="登录密码"></el-input>
+              <el-input type="password" v-model="item.password" auto-complete="new-password" placeholder="登录密码"></el-input>
               <div class="pwd sm" v-show="showMsgTip1">密码强度 <em></em><em></em><em></em><span>弱</span></div>
               <div class="pwd md" v-show="showMsgTip2">密码强度 <em></em><em></em><em></em><span>中</span></div>
               <div class="pwd lar" v-show="showMsgTip3">密码强度 <em></em><em></em><em></em><span>强</span></div>
@@ -22,7 +22,7 @@
               <el-input type="password"
                         v-model="item.confirm"
                         v-bind:class="{active: showPasswordError}"
-                        auto-complete="off"
+                        auto-complete="new-password"
                         placeholder="密码确认"></el-input>
               <span class="tip passwordError" v-show="showPasswordError">两次输入密码不一致</span>
             </el-form-item>
@@ -44,21 +44,22 @@
               <span v-show="codeErrorChecked" class="codeError-tip">{{codeErrorMsg}}</span>
             </el-form-item>
             <el-form-item>
-              <!--<el-button type="primary" @click="submitForm('item')" :disabled="!this.item.vipName || !this.item.password || !this.item.confirm  || !this.item.code || !this.checked" class="finish">完成注册</el-button>-->
-              <a class="btn finish" @click="submit"
-                 :disabled="!this.vipNameChecked || !this.passwordChecked || !this.confirmChecked || !this.mobileChecked || !this.codeChecked || !this.checked">完成注册</a>
+              <a class="btn finish" @click="submit">确认注册</a>
             </el-form-item>
 
             <el-form-item>
               <el-checkbox name="type" v-model="checked" @click="checkboxChecked"></el-checkbox>
-              <span class="agree">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
+              <span class="agree" v-if="!agreementUrl || (agreementUrl && (JSON.parse(agreementUrl.terms).isUrl))">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
+              <span class="agree" v-else>我已阅读并同意<a :href="`/common/cityAgreement/?appId=${this.$route.query.appId}`">《{{JSON.parse(agreementUrl.terms).name || ''}}》</a></span>
             </el-form-item>
           </el-form>
         </div>
       </div>
-      <div class="login">已有账号?<a href="/">立即登录</a></div>
+      <div class="login">已有账号?<a :href="returnLogin">立即登录</a></div>
       <loading v-show="isShowLoading"/>
     </div>
+    <!--尾部-->
+    <div v-html="loginStyle.footUrl" class="footer"></div>
   </div>
 </template>
 
@@ -215,11 +216,11 @@
           this.codeErrorChecked = false
           this.codeChecked = false
         } else {
-          if (this.item.code !== '') {
-            if (this.item.mobile === '') {
-              callback(new Error('请先填写正确的手机号'))
-            } else {
-              if (this.token) {
+          if (this.item.mobile === '') {
+            callback(new Error('请先填写正确的手机号'))
+          } else {
+            if (this.token) {
+              if (this.item.code.length === 6) {
                 let param = new FormData()
                 param.append('mobile', this.item.mobile)
                 param.append('code', this.item.code)
@@ -240,13 +241,62 @@
                     }
                   }).catch(err => {
                     this.codeErrorMsg = err.errMsg
-//                  this.$message.error(err.errMsg)
+  //                  this.$message.error(err.errMsg)
                   })
               } else {
-                callback(new Error('请先获取验证码'))
+                callback(new Error('请输入正确的验证码'))
                 this.codeChecked = false
                 this.codeErrorChecked = false
               }
+            } else {
+              callback(new Error('请先获取验证码'))
+              this.codeChecked = false
+              this.codeErrorChecked = false
+            }
+          }
+          callback()
+        }
+      }
+      var validateCodeIsEmpty = (rule, value, callback) => {
+        if (value === '') {
+          callback(new Error('请填写正确的验证码'))
+          this.codeErrorChecked = false
+          this.codeChecked = false
+        } else {
+          if (this.item.mobile === '') {
+            callback(new Error('请先填写正确的手机号'))
+          } else {
+            if (this.token) {
+              if (this.item.code.length === 6) {
+                let param = new FormData()
+                param.append('mobile', this.item.mobile)
+                param.append('code', this.item.code)
+                param.append('token', this.token)
+                let config = {
+                  headers: {'Content-Type': 'multipart/form-data'}
+                }
+                this.$http.post(`/sso/personal/register/checkCode`, param, config)
+                  .then(response => {
+                    if (response.data.success) {
+                      this.codeChecked = true
+                      this.codeErrorChecked = false
+                    } else {
+                      this.codeErrorChecked = true
+                      this.codeChecked = false
+                      return Promise.reject(response.data)
+                    }
+                  }).catch(err => {
+                    this.codeErrorMsg = err.errMsg
+                  })
+              } else {
+                callback(new Error('请输入正确的验证码'))
+                this.codeChecked = false
+                this.codeErrorChecked = false
+              }
+            } else {
+              callback(new Error('请先获取验证码'))
+              this.codeChecked = false
+              this.codeErrorChecked = false
             }
           }
           callback()
@@ -282,6 +332,7 @@
         personal_time: 0,
         queryLink: '',
         appId: '',
+        returnLogin: '',
         rules2: {
           vipName: [
             { validator: validateName, trigger: 'blur' }
@@ -297,7 +348,8 @@
             { validator: validateMobile, trigger: 'blur' }
           ],
           code: [
-            { validator: validateCode, trigger: 'blur' }
+            { validator: validateCode, trigger: 'change' },
+            { validator: validateCodeIsEmpty, trigger: 'blur' }
           ]
         }
       }
@@ -308,11 +360,21 @@
         this.getUrl()
       })
     },
+    computed: {
+      loginStyle () {
+        return this.$store.state.login.loginStyle.data.content
+      },
+      agreementUrl () {
+        return this.$store.state.login.agreementUrl.data.content
+      }
+    },
     methods: {
       // 获取链接
       getUrl () {
         var url = window.location.search
         var request = {}
+        var origin = window.location.origin
+        this.returnLogin = origin + url
         if (url.indexOf('?' !== -1)) {
           var str = url.substr(1)
           var strs = str.split('&')
@@ -334,34 +396,116 @@
 //      表单提交
       submit () {
         if (this.vipNameChecked && this.passwordChecked && this.confirmChecked && this.mobileChecked && this.codeChecked && this.checked) {
-          this.isShowLoading = true
-          let param = new FormData()
-          param.append('vipName', this.item.vipName)
-          param.append('password', this.item.password)
-          param.append('mobile', this.item.mobile)
+          if (this.item.password !== this.item.confirm) {
+            this.$message.error('请确认两次填写密码是否一致')
+          } else {
+            this.isShowLoading = true
+            let param = new FormData()
+            param.append('vipName', this.item.vipName)
+            param.append('password', this.item.password)
+            param.append('mobile', this.item.mobile)
 //          param.append('mobileArea', '')
-          param.append('appId', this.appId)
-          param.append('code', this.item.code)
-          param.append('token', this.token)
-          let config = {
-            headers: {'Content-Type': 'multipart/form-data'}
+            param.append('appId', this.appId)
+            param.append('code', this.item.code)
+            param.append('token', this.token)
+            let config = {
+              headers: {'Content-Type': 'multipart/form-data'}
+            }
+            this.$http.post('/sso/personal/register', param, config)
+              .then(response => {
+                this.isShowLoading = false
+                if (response.data.success) {
+                  if (response.data.content.type) {
+                    console.log(111)
+                    if (response.data.content.type === 'mall') {
+                      let param = response.data.content.data
+                      let a = ''
+                      for (let n in param) {
+                        a += (n + '=' + encodeURIComponent(param[n]) + '&')
+                      }
+                      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)
+                      }
+                    } else if (response.data.content.type === 'city') {
+                      let param = response.data.content.data
+                      let a = ''
+                      for (let n in param) {
+                        a += (n + '=' + encodeURIComponent(param[n]) + '&')
+                      }
+                      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.loginCityOther(response, params)
+                          }
+                        })
+                      } else {
+                        this.loginCityOther(response, params, 3000)
+                      }
+                    }
+                  } else {
+                    let userUU = response.data.content.userUU
+                    console.log(userUU)
+                    window.location.href = `/overRegister/${userUU}`
+                  }
+                } else {
+                  return Promise.reject(response.data)
+                }
+              }).catch(err => {
+                this.$message.error(err.errMsg)
+                this.isShowLoading = false
+                this.personal_time = 0
+              })
+          }
+        } else {
+          if (!this.item.vipName) {
+            this.$message.error('会员名不能为空')
+          } else if (!this.vipNameChecked) {
+            this.$message.error('会员名输入有误,请按提示重新输入')
+          } else if (!this.item.password) {
+            this.$message.error('密码不能为空')
+          } else if (!this.passwordChecked) {
+            this.$message.error('密码输入有误,请按提示重新输入')
+          } else if (!this.item.confirm) {
+            this.$message.error('请再次输入密码')
+          } else if (!this.confirmChecked) {
+            this.$message.error('请确认两次填写密码是否一致')
+          } else if (!this.item.mobile) {
+            this.$message.error('手机号不能为空')
+          } else if (!this.mobileChecked) {
+            this.$message.error('手机号输入有误,请按提示重新输入')
+          } else if (!this.token) {
+            this.$message.error('请先获取验证码')
+          } else if (!this.item.code) {
+            this.$message.error('验证码不能为空')
+          } else if (!this.codeChecked) {
+            this.$message.error('验证码输入有误,请按提示重新输入')
+          } else if (!this.checked) {
+            this.$message.error('您对阅读条款未做勾选')
           }
-          this.$http.post('/sso/personal/register', param, config)
-            .then(response => {
-              this.isShowLoading = false
-              if (response.data.success) {
-                let userUU = response.data.content.userUU
-                window.location.href = `/overRegister/${userUU}`
-              } else {
-                return Promise.reject(response.data)
-              }
-            }).catch(err => {
-              this.$message.error(err.errMsg)
-              this.isShowLoading = false
-              // this.codeErrorChecked = true
-              // this.codeChecked = false
-              this.personal_time = 0
-            })
         }
       },
 //      获取验证码
@@ -399,6 +543,53 @@
             this.isShowLoading = false
             this.$message.error(err.errMsg)
           })
+      },
+      getJsonp: function (url, timeout = 500) {
+        return new Promise((resolve, reject) => {
+          this.$jsonp(url, {
+            name: 'successCallback',
+            timeout: timeout
+          }, function (err, data) {
+            if (err) {
+              reject(err)
+              throw err
+            } else {
+              resolve(data)
+            }
+          })
+        })
+      },
+      crossAfter (url) {
+        try {
+          window.location.href = url
+        } catch (err) {
+          console.log(err)
+        }
+      },
+      loginOther (response, a, timeout) {
+        const crossAfter = this.crossAfter
+        let promises = []
+        for (let i in response.data.content.loginUrls) {
+          promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
+        }
+        let returnUrl = decodeURIComponent(this.$route.query.returnURL)
+        Promise.all(promises).then(() => {
+          crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
+        }).catch(() => {
+          crossAfter(returnUrl || 'http://www.ubtob.com', timeout)
+        })
+      },
+      loginCityOther (response, a, timeout) {
+        const crossAfter = this.crossAfter
+        let promises = []
+        for (let i in response.data.content.loginUrls) {
+          promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
+        }
+        Promise.all(promises).then(() => {
+          crossAfter('/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath || '/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath, timeout)
+        }).catch(() => {
+          crossAfter('/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath || '/overRegister/cityRegisterOver/' + this.$store.state.option.fullPath, timeout)
+        })
       }
     }
   }
@@ -629,4 +820,7 @@
       }
     }
   }
+  .footer{
+    padding: 50px 0;
+  }
 </style>

+ 2 - 1
components/register/index.js

@@ -1,4 +1,5 @@
 import PersonalRegistration from './PersonalRegistration.vue'
 import EnterpriseRegistration from './EnterpriseRegistration.vue'
+import CityRegister from './CityRegister.vue'
 
-export { PersonalRegistration, EnterpriseRegistration }
+export { PersonalRegistration, EnterpriseRegistration, CityRegister }

+ 1 - 1
components/reset/ChangePasswordChooseStyle.vue

@@ -155,7 +155,7 @@
                     }
                   }).catch(err => {
                     this.codeErrorMsg = err.errMsg
-                    this.codeErrorChecked = false
+                    this.codeErrorChecked = true
                     this.codeChecked = false
                   })
               }

+ 10 - 0
layouts/isCityFooter.vue

@@ -0,0 +1,10 @@
+<template>
+  <div>
+    <nuxt/>
+  </div>
+</template>
+<script>
+  export default {
+    name: 'isCityFooter'
+  }
+</script>

+ 1 - 1
layouts/mobile.vue

@@ -12,7 +12,7 @@
           { name: 'apple-mobile-web-app-capable', content: 'yes' },
           { name: 'MobileOptimized', content: '320' },
           { name: 'HandheldFriendly', content: 'true' },
-          { name: 'viewport', content: 'width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no' },
+          { name: 'viewport', content: 'width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.3,user-scalable=no' },
           { 'http-equiv': 'Cache-Control', content: 'no-siteapp' },
           { name: 'format-detection', content: 'telephone=no, email=no' }
         ]

+ 1 - 1
nuxt.config.js

@@ -105,5 +105,5 @@ module.exports = {
     ssr: true
   }],
   /* TODO 暂时代理到商城测试版,之后再做出调整 */
-  proxyTable: ['/api/**', '/login/**', '/user**', '/logout**', '/sso/**', '/appeal/**', '/update/user/**', '/valid/**']
+  proxyTable: ['/api/**', '/login/**', '/user**', '/logout**', '/sso/**', '/appeal/**', '/update/user/**', '/valid/**', '/im/**']
 }

+ 2 - 1
package.json

@@ -6,6 +6,7 @@
   "private": true,
   "dependencies": {
     "axios": "^0.15.3",
+    "babel-polyfill": "^6.26.0",
     "bezier-easing": "^2.0.3",
     "bootstrap": "^3.3.7",
     "cookiejar": "^2.1.1",
@@ -52,7 +53,7 @@
     "eslint-plugin-html": "^2.0.0",
     "eslint-plugin-promise": "^3.4.1",
     "eslint-plugin-standard": "^2.0.1",
-    "node-sass": "^4.5.3",
+    "node-sass": "^4.9.0",
     "nodemon": "^1.14.11",
     "sass-loader": "^6.0.6"
   }

+ 104 - 20
pages/agency/index.vue

@@ -1,12 +1,17 @@
-
-
-
-
-
 <template>
-  <div class="logout">
-    <loading/>
-    <p>跳转中,请稍后...</p>
+  <div>
+    <div class="logout">
+      <loading/>
+      <p>跳转中,请稍后...</p>
+    </div>
+    <template v-if="isMobile">
+      <mt-popup v-model="popupVisible" position="right" class="mint-popup" :modal="false">
+        <ul style="height:100vh;overflow-y:auto">
+          <li class="listitem itemgreen">选择您要登录的公司:</li>
+          <li v-for="item in enterprise" class="listitem" @click="selectEnterprise(false, item.id)">{{ item.name }}</li>
+        </ul>
+      </mt-popup>
+    </template>
   </div>
 </template>
 
@@ -15,22 +20,42 @@
   export default {
     name: 'agency',
     layout: 'mobile',
+    data () {
+      return {
+        popupVisible: false,
+        spaceUU: ''
+      }
+    },
     components: {
       Loading
     },
     mounted () {
       this.$nextTick(() => {
-        this.agency()
+        this.agency(true)
       })
     },
+    computed: {
+      isMobile () {
+        return this.$store.state.option.isMobile
+      },
+      enterprise () {
+        return this.$store.state.login.chooseRegisterEnterprise.choose.data
+      }
+    },
     methods: {
-      agency () {
+      selectEnterprise (flag, type) {
+        // console.log('type', type)
+        this.spaceUU = type
+        this.popupVisible = flag
+        this.agency(flag)
+      },
+      agency (flag) {
         let param = new FormData()
         param.append('returnUrl', this.$route.query.returnURL || '')
         param.append('appId', this.$route.query.appId || '')
         param.append('token', this.$route.query.token || '')
         param.append('baseUrl', this.$route.query.baseURL || '')
-        param.append('spaceUU', this.$route.query.spaceUU || '')
+        param.append('spaceUU', this.spaceUU || this.$route.query.spaceUU || '')
         param.append('isLoginAll', this.$route.query.isLoginAll || '')
         let config = {
           headers: {'Content-Type': 'multipart/form-data'}
@@ -39,25 +64,84 @@
         this.$http.post(url, param, config)
           .then(response => {
             if (response.data.success) {
-              if (response.data.content.loginUrls) {
+              // console.log('res', response.data.content)
+              if (response.data.content.spaces) {
+                this.$store.commit('login/chooseRegisterEnterprise/GET_ENTERPRISE_SUCCESS', response.data.content.spaces)
+                this.popupVisible = flag
+              } else if (response.data.content.loginUrls) {
                 // 遍历登录url循环让各应用登录(需要跨域)
                 let param = response.data.content.data
                 let a = ''
                 for (let n in param) {
-                  a += (n + '=' + param[n] + '&')
+                  a += (n + '=' + encodeURIComponent(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, data) {
-                    if (err) throw err
-                    console.log(data)
+                let params = a.substr(0, a.length - 1)
+                if (response.data.content.currentUrl) {
+                  this.$jsonp(`${response.data.content.currentUrl}?${params}`, {
+                    name: 'successCallback',
+                    timeout: 5000
+                  }, (err, data) => {
+                    const crossAfter = this.crossAfter
+                    if (err) {
+                      this.$indicator.close()
+                      this.$toast({
+                        message: '登录超时,即将跳转...',
+                        iconClass: 'el-icon-error'
+                      })
+                      setTimeout(() => {
+                        crossAfter(response.data.content.returnUrl || 'http://www.ubtob.com')
+                      }, 1000)
+                      throw err
+                    } else {
+                      this.loginOther(response, params)
+                    }
                   })
+                } else {
+                  this.loginOther(response, params, 3000)
                 }
-              }
-              setTimeout(function () {
+              } else {
                 window.location.href = response.data.content.returnUrl || 'http://www.ubtob.com'
-              }, 3000)
+              }
+            } else {
+              return Promise.reject(response.data)
             }
+          }).catch(err => {
+            this.$message.error(err.errMsg)
           })
+      },
+      getJsonp: function (url, timeout = 500) {
+        return new Promise((resolve, reject) => {
+          this.$jsonp(url, {
+            name: 'successCallback',
+            timeout: timeout
+          }, function (err, data) {
+            if (err) {
+              reject(err)
+              throw err
+            } else {
+              resolve(data)
+            }
+          })
+        })
+      },
+      crossAfter (url) {
+        try {
+          window.location.href = url
+        } catch (err) {
+          console.log(err)
+        }
+      },
+      loginOther (response, a, timeout) {
+        const crossAfter = this.crossAfter
+        let promises = []
+        for (let i in response.data.content.loginUrls) {
+          promises.push(this.getJsonp(`${response.data.content.loginUrls[i]}?${a}`))
+        }
+        Promise.all(promises).then(() => {
+          crossAfter(response.data.content.returnUrl || 'http://www.ubtob.com', timeout)
+        }).catch(() => {
+          crossAfter(response.data.content.returnUrl || 'http://www.ubtob.com', timeout)
+        })
       }
     }
   }

+ 6 - 3
pages/common/agreement.vue

@@ -85,7 +85,7 @@
     </template>
     <template v-else>
       <div>
-        <accountCenter-header/>
+        <registerCenter-header/>
       </div>
       <div class="x-content">
         <div class="container">
@@ -176,13 +176,16 @@
   </div>
 </template>
 <script>
-  import AccountCenterHeader from '~components/default/AccountCenterHeader.vue'
+  import RegisterCenterHeader from '~components/default/RegisterCenterHeader.vue'
   export default {
     layout (context) {
       return context.store.state.option.isMobile ? 'mobile' : 'default'
     },
     components: {
-      AccountCenterHeader
+      RegisterCenterHeader
+    },
+    fetch ({store, route}) {
+      return Promise.all([store.dispatch('GetLoginStyle', {appId: route.query.appId})])
     },
     computed: {
       isMobile () {

+ 133 - 0
pages/common/cityAgreement.vue

@@ -0,0 +1,133 @@
+<template>
+  <div>
+    <template>
+      <div>
+        <registerCenter-header/>
+      </div>
+      <div class="x-content">
+        <div class="container">
+          <div class="x-form-wrap">
+            <%--优软云协议开始--%>
+            <div class="rules-content" v-html="agreementUrl.term"></div>
+          </div>
+        </div>
+      </div>
+    </template>
+    <div v-html="loginStyle.footUrl" style="margin: 50px 0;"></div>
+  </div>
+</template>
+<script>
+  import RegisterCenterHeader from '~components/default/RegisterCenterHeader.vue'
+  export default {
+    layout (context) {
+      return context.store.state.option.isMobile ? 'mobile' : 'isCityFooter'
+    },
+    components: {
+      RegisterCenterHeader
+    },
+    fetch ({store, route}) {
+      return Promise.all([
+        store.dispatch('GetLoginStyle', {appId: route.query.appId}),
+        store.dispatch('GetAgreementUrl', {appId: route.query.appId})
+      ])
+    },
+    computed: {
+      isMobile () {
+        return this.$store.state.option.isMobile
+      },
+      loginStyle () {
+        return this.$store.state.login.loginStyle.data.content
+      },
+      agreementUrl () {
+        return this.$store.state.login.agreementUrl.data.content
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .x-content .container .x-form-wrap .rules-content{
+    color: #000;
+  }
+  .w-form-wrap {
+    padding: .2rem;
+    background: #fff;
+    border: 1px solid #e4ecf3;
+    padding-bottom: .4rem;
+    .rules-content {
+      width: 100%;
+      margin: 0 auto;
+      color: #000;
+      h3 {
+        font-size: 14px;
+        font-weight: bold;
+        line-height: 80px;
+        text-align: center;
+        margin-bottom: 0;
+        color: #333;
+      }
+      .content {
+        width: 98%;
+        margin: 0 auto;
+        font-size: 14px;
+        color: #333;
+        p {
+          font-size: 14px;
+          color: #333;
+          margin-bottom: 0;
+          line-height: 35px;
+          strong{
+            font-weight: bold;
+          }
+        }
+        div {
+          line-height: 35px;
+        }
+      }
+    }
+  }
+  .x-content {
+    position: relative;
+    margin-top: 30px;
+    .container{
+      width: 990px!important;
+      position: relative;
+      .x-form-wrap {
+        padding: 20px;
+        background: #fff;
+        border: 1px solid #e4ecf3;
+        padding-bottom: 40px;
+        .rules-content {
+          width: 100%;
+          margin: 0 auto;
+          h3 {
+            font-size: 18px;
+            font-weight: bold;
+            line-height: 80px;
+            text-align: center;
+            margin-bottom: 0;
+            color: #333;
+          }
+          .content {
+            width: 98%;
+            margin: 0 auto;
+            font-size: 14px;
+            color: #333;
+            p {
+              font-size: 14px;
+              color: #333;
+              margin-bottom: 0;
+              /* text-indent: 2em; */
+              line-height: 35px;
+              strong{
+                font-weight: bold;
+              }
+            }
+            div {
+              line-height: 35px;
+            }
+          }
+        }
+      }
+    }
+  }
+</style>

+ 4 - 1
pages/index.vue

@@ -14,7 +14,10 @@
   import {LoginMobile, HeaderMobile} from '~components/mobile'
   export default {
     layout (context) {
-      return context.store.state.option.isMobile ? 'mobile' : 'loginDefault'
+      return context.store.state.option.isMobile ? 'mobile' : 'isCityFooter'
+    },
+    fetch ({store, route}) {
+      return Promise.all([store.dispatch('GetLoginStyle', {appId: route.query.appId})])
     },
     components: {
       Login,

+ 3 - 1
pages/logquit/index.vue

@@ -23,7 +23,6 @@
         this.$http.get('/sso/login/logout', {params: this.$route.query})
           .then(response => {
             if (response.data.success) {
-              window.location.href = `${response.data.content.returnURL}`
               for (let i = 0; i < response.data.content.logoutUrls.length; i++) {
                 if (response.data.content.logoutUrls[i]) {
                   this.$jsonp(`${response.data.content.logoutUrls[i]}`, function (err) {
@@ -31,6 +30,9 @@
                   })
                 }
               }
+              setTimeout(function () {
+                window.location.href = `${response.data.content.returnURL}`
+              }, 1000)
             }
           })
       }

+ 27 - 0
pages/overRegister/cityRegisterOver.vue

@@ -0,0 +1,27 @@
+<template>
+  <div>
+    <template>
+      <registerCenter-header/>
+    </template>
+    <template>
+      <cityRegister-over/>
+    </template>
+  </div>
+</template>
+
+<script>
+  import RegisterCenterHeader from '~components/default/RegisterCenterHeader.vue'
+  import CityRegisterOver from '~components/register/CityRegisterOver.vue'
+  export default {
+    layout: 'isCityFooter',
+    components: {
+      RegisterCenterHeader,
+      CityRegisterOver
+    },
+    fetch ({store, route}) {
+      return Promise.all([
+        store.dispatch('GetLoginStyle', {appId: route.query.appId})
+      ])
+    }
+  }
+</script>

+ 10 - 4
pages/register/enterpriseRegistration.vue

@@ -6,22 +6,28 @@
       <footer-mobile/>
     </template>
     <template v-else>
-      <accountCenter-header/>
+      <registerCenter-header/>
       <enterprise-registration/>
     </template>
   </div>
 </template>
 <script>
-  import AccountCenterHeader from '~components/default/AccountCenterHeader.vue'
+  import RegisterCenterHeader from '~components/default/RegisterCenterHeader.vue'
   import EnterpriseRegistration from '~components/register/EnterpriseRegistration.vue'
   import { HeaderMobile, FooterMobile } from '~components/mobile'
   import registerEnterpriseMobile from '~components/mobile/registerEnterprise'
   export default {
     layout (context) {
-      return context.store.state.option.isMobile ? 'mobile' : 'default'
+      return context.store.state.option.isMobile ? 'mobile' : 'isCityFooter'
+    },
+    fetch ({store, route}) {
+      return Promise.all([
+        store.dispatch('GetLoginStyle', {appId: route.query.appId}),
+        store.dispatch('GetAgreementUrl', {appId: route.query.appId})
+      ])
     },
     components: {
-      AccountCenterHeader,
+      RegisterCenterHeader,
       EnterpriseRegistration,
       registerEnterpriseMobile,
       HeaderMobile,

+ 10 - 9
pages/register/personalRegistration.vue

@@ -6,32 +6,33 @@
       <footer-mobile/>
     </template>
     <template v-else>
-      <accountCenter-header/>
+      <registerCenter-header/>
       <personal-registration/>
     </template>
   </div>
 </template>
 <script>
-  import AccountCenterHeader from '~components/default/AccountCenterHeader.vue'
+  import RegisterCenterHeader from '~components/default/RegisterCenterHeader.vue'
   import PersonalRegistration from '~components/register/PersonalRegistration.vue'
   import { HeaderMobile, FooterMobile } from '~components/mobile'
   import registerPersonalMobile from '~components/mobile/registerPersonal'
   export default {
     layout (context) {
-      return context.store.state.option.isMobile ? 'mobile' : 'default'
+      return context.store.state.option.isMobile ? 'mobile' : 'isCityFooter'
+    },
+    fetch ({store, route}) {
+      return Promise.all([
+        store.dispatch('GetLoginStyle', {appId: route.query.appId}),
+        store.dispatch('GetAgreementUrl', {appId: route.query.appId})
+      ])
     },
     components: {
-      AccountCenterHeader,
+      RegisterCenterHeader,
       PersonalRegistration,
       HeaderMobile,
       FooterMobile,
       registerPersonalMobile
     },
-    fetch ({store, route}) {
-      return Promise.all([
-
-      ])
-    },
     computed: {
       isMobile () {
         return this.$store.state.option.isMobile

+ 0 - 1
plugins/axios.js

@@ -14,7 +14,6 @@ service.interceptors.request.use(config => {
     config.headers.cookie = store.state.option.cookies + '; ' + store.state.option.sessionId
     config.headers['User-Agent'] = store.state.option.userAgent
   }
-
   return config
 }, error => {
   return Promise.reject(error)

BIN
static/images/all/success.png


BIN
static/images/all/sucess.png


+ 18 - 0
store/index.js

@@ -119,5 +119,23 @@ export const actions = {
       }, err => {
         commit('formConfig/GET_FORMDATA_FAILURE', err)
       })
+  },
+  // 登录页样式
+  GetLoginStyle ({ commit }, params = {}) {
+    return axios.get('/sso/login/page/style', { params })
+      .then(response => {
+        commit('login/REQUEST_LOGIN_STYLE_SUCCESS', response.data)
+      }, err => {
+        commit('login/GET_LOGIN_STYLE_FAILURE', err)
+      })
+  },
+  // 获取协议
+  GetAgreementUrl ({ commit }, params = {}) {
+    return axios.get('/api/app/getAgreementUrl', { params })
+      .then(response => {
+        commit('login/REQUEST_AGREEMENT_URL_SUCCESS', response.data)
+      }, err => {
+        commit('login/GET_AGREEMENT_URL_FAILURE', err)
+      })
   }
 }

+ 28 - 0
store/login.js

@@ -17,11 +17,39 @@
 export const state = () => ({
   token: {
     data: ''
+  },
+  loginStyle: {
+    fetching: false,
+    data: {}
+  },
+  agreementUrl: {
+    fetching: false,
+    data: {}
   }
 })
 
 export const mutations = {
   GET_TOKEN (state, res) {
     state.token.data = res
+  },
+  REQUEST_LOGIN_STYLE (state) {
+    state.loginStyle.fetching = true
+  },
+  REQUEST_LOGIN_STYLE_SUCCESS (state, result) {
+    state.loginStyle.data = result
+    state.loginStyle.fetching = false
+  },
+  REQUEST_LOGIN_STYLE_FAILURE (state) {
+    state.loginStyle.fetching = false
+  },
+  REQUEST_AGREEMENT_URL (state) {
+    state.agreementUrl.fetching = true
+  },
+  REQUEST_AGREEMENT_URL_SUCCESS (state, result) {
+    state.agreementUrl.data = result
+    state.agreementUrl.fetching = false
+  },
+  REQUEST_AGREEMENT_URL_FAILURE (state) {
+    state.agreementUrl.fetching = false
   }
 }