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

注册、密码重置、验证手机和邮箱增加页面加载过程以及密码重置增加密码输入是否一致的多次判断

hangb пре 7 година
родитељ
комит
e983a64ecb

+ 4 - 4
assets/scss/common.scss

@@ -699,18 +699,18 @@ form .questions .el-form-item__content span.question {
 
 
 // 模态框样式处理
-.el-dialog__wrapper{
+.center .el-dialog__wrapper{
   z-index:10000;
 }
-.el-dialog__body{
+.center .el-dialog__body{
   text-align: center!important;
   border-top:1px solid #d2d2d2!important;
 }
-.el-dialog__footer{
+.center .el-dialog__footer{
   text-align: center!important;
   padding: 60px 15px 40px;
 }
-.el-dialog__footer .el-button{
+.center .el-dialog__footer .el-button{
   width:180px;
   height:30px;
   line-height: 30px;

+ 11 - 22
components/common/loading/Loading.vue

@@ -1,36 +1,25 @@
-<template lang="html">
-  <div class="loading" v-if="loading">
+<template>
+  <div class="loading">
     <img src="/images/all/loading.gif" alt="">
   </div>
 </template>
-<script>
-  export default {
-    data: () => ({
-      loading: false
-    }),
-    methods: {
-      start () {
-        this.loading = true
-      },
-      finish () {
-        this.loading = false
-      }
-    }
-  }
-</script>
-<style scoped>
+<style lang="scss" scoped>
   .loading {
     position: fixed;
     top: 0;
     left: 0;
     right: 0;
-    width:  100%;
-    height: 100%;
+    margin: 0 auto;
     z-index: 1000;
+    width: 100%;
+    height: 100%;
     text-align: center;
-  }
-  .loading img {
+    background: transparent;
+  >img {
     position: relative;
     top: 40%;
+    width: 64px;
+    height: 64px;
+  }
   }
 </style>

+ 36 - 0
components/common/nuxt-loading/Loading.vue

@@ -0,0 +1,36 @@
+<template lang="html">
+  <div class="loading" v-if="loading">
+    <img src="/images/all/loading.gif" alt="">
+  </div>
+</template>
+<script>
+  export default {
+    data: () => ({
+      loading: false
+    }),
+    methods: {
+      start () {
+        this.loading = true
+      },
+      finish () {
+        this.loading = false
+      }
+    }
+  }
+</script>
+<style scoped>
+  .loading {
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    width:  100%;
+    height: 100%;
+    z-index: 1000;
+    text-align: center;
+  }
+  .loading img {
+    position: relative;
+    top: 40%;
+  }
+</style>

+ 78 - 0
components/default/EmailLinkPage.vue

@@ -0,0 +1,78 @@
+<template>
+  <div class="email">
+    <div class="header">
+      <p>您好,<span>真烦</span></p>
+    </div>
+    <div class="body">
+      <p class="first">您正在使用优软账户中心密码重置功能,您可以<a href="">点击这里</a>,或者复制以下链接通过浏览器打开:
+        <a href=""> https://account.ubtob.com/sso/register?token=${token}#/valid </a>来完成重置密码。
+        重置链接有效期24小时。
+      </p>
+      <p class="second">祝您使用愉快!</p>
+      <p class="second">优软云团队</p>
+    </div>
+    <div class="footer">
+      如果您有任何的疑问,请咨询 <a href="">客服中心</a>,联系电话:<a href="">400-830-1818</a>
+    </div>
+  </div>
+</template>
+<script>
+  export default {
+    name: 'EmailLinkPage'
+  }
+</script>
+<style lang="scss" scoped>
+  .email{
+    margin: 0 auto;
+    width: 980px;
+  }
+  .email .header{
+    padding-left: 5px;
+    margin-top: 40px;
+    width: 100%;
+    height: 30px;
+    line-height: 30px;
+    background: #eee;
+  }
+  .email .header p{
+    font-size:14px;
+    font-weight: bold;
+    color: #000;
+  }
+  .email .header p span{
+    font-size: 14px;
+    color: red;
+  }
+  .email .body{
+    padding: 50px 0 30px 5px;
+    width: 100%;
+    background: #fff;
+  }
+  .email .body p{
+    line-height: 25px;
+    font-size: 14px;
+    color: #333;
+  }
+  .email .body p a{
+    font-size: 14px;
+    color: #007ebf;
+  }
+
+  .email .body p.first{
+    text-align: left;
+  }
+  .email .body p.second{
+    margin-bottom: 0;
+    text-align: right;
+  }
+  .email .footer{
+      padding: 20px 0 60px 5px;
+      font-size: 14px;
+      color: #8c8c8c;
+      border-top: 2px solid #989898;
+  }
+  .email .footer a{
+        font-size: 14px;
+        color: #007ebf;
+  }
+</style>

+ 2 - 1
components/default/index.js

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

+ 45 - 19
components/login/Login.vue

@@ -37,7 +37,7 @@
                 <a class="code-click" @click="getCode">看不清换一张</a>
               </el-form-item>
               <el-form-item class="text-right">
-                <a class="forget">忘记密码?</a>
+                <a class="forget" id='forget' @click="goForgetPassword">忘记密码?</a>
               </el-form-item>
               <el-form-item>
                 <a class="btn login"
@@ -50,7 +50,7 @@
             为确保您账户的安全及正常使用,依《网络安全法》相关要求,6月1日起会员账户需绑定手机、设置密码保护。感谢您的理解和支持!
           </div>
           <div style="text-align: right;">
-            <a href="sso/register_mall?appId=home&amp;returnURL=https%3A%2F%2Fwww.ubtob.com%2F">
+            <a id="register" @click="goRegister">
               <i class="fa fa-arrow-circle-o-right"></i>免费注册</a>
           </div>
         </div>
@@ -163,6 +163,11 @@
         }
       }
     },
+    mounted () {
+      this.$nextTick(() => {
+        this.getUrl()
+      })
+    },
     computed: {
       enterprise () {
         let chooseEnterprise = this.$store.state.login.chooseRegisterEnterprise.choose.data
@@ -171,7 +176,36 @@
       }
     },
     methods: {
-//    获取验证码
+//      获取url参数
+      getUrl () {
+        var url = window.location.search
+        var request = {}
+        if (url.indexOf('?' !== -1)) {
+          var str = url.substr(1)
+          var strs = str.split('&')
+          for (var i = 0; i < strs.length; i++) {
+            request[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1])
+          }
+        }
+        this.appId = request['appId'] || ''
+        this.returnUrl = request['returnUrl'] || ''
+        this.baseUrl = request['baseUrl'] || ''
+      },
+//      忘记密码
+      goForgetPassword () {
+        let url = `/reset/forgetPasswordValidationAccount?appId=${this.appId}&returnUrl=${this.returnUrl}`
+        document.getElementById('forget').href = url
+      },
+//      去注册
+      goRegister () {
+        if (this.appId === 'mall') {
+          var registerurl = `/register/personalRegistration?appId=${this.appId}&returnUrl=${this.returnUrl}`
+        } else {
+          registerurl = `/register/enterpriseRegistration?appId=${this.appId}&returnUrl=${this.returnUrl}`
+        }
+        document.getElementById('register').href = registerurl
+      },
+  //    获取验证码
       getCode () {
         var imgSrc = document.getElementById('captchaImage')
         imgSrc.setAttribute('src', '/sso/login/checkCode?timestamp=' + (new Date()).valueOf())
@@ -183,25 +217,13 @@
         } else if (!this.checkPassword) {
           this.$message.error('请填写密码')
         } else {
-          var url = window.location.search
-          var request = {}
-          if (url.indexOf('?' !== -1)) {
-            var str = url.substr(1)
-            var strs = str.split('&')
-            for (var i = 0; i < strs.length; i++) {
-              request[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1])
-            }
-          }
-          var appId = request['appId'] || ''
-          var returnUrl = request['returnUrl'] || ''
-          var baseUrl = request['baseUrl'] || ''
           let param = new FormData()
           param.append('username', this.login.username)
           param.append('password', this.login.password)
           param.append('captcha', this.login.captcha)
-          param.append('appId', appId)
-          param.append('returnUrl', returnUrl)
-          param.append('baseUrl', baseUrl)
+          param.append('appId', this.appId)
+          param.append('returnUrl', this.returnUrl)
+          param.append('baseUrl', this.baseUrl)
           param.append('spaceUU', this.login.spaceUU)
           let config = {
             headers: {'Content-Type': 'multipart/form-data'}
@@ -217,7 +239,11 @@
                 } else if (response.data.content.loginUrls) {
 //                  遍历登录url循环让各应用登录(需要跨域)
                   for (var i in response.data.content.loginUrls) {
-                    this.$http.post(response.data.content.loginUrls[i], response.data.content.data)
+//                    this.$http.post(response.data.content.loginUrls[i], response.data.content.data)
+                    this.$jsonp(`response.data.content.loginUrls${[i]}`, function (err, data) {
+                      if (err) throw err
+                      console.log(data)
+                    })
                   }
                   window.location.href = response.data.content.returnUrl || 'http://www.ubtob.com'
                 }

+ 45 - 22
components/register/EnterpriseRegistration.vue

@@ -26,7 +26,7 @@
             </el-form-item>
             <el-form-item>
               <a class="btn finish"
-                 @click="CheckPhone"
+                 @click="checkPhone"
                  :disabled="!this.checked || !this.mobileChecked || !this.codeChecked">验证手机</a>
             </el-form-item>
             <el-form-item>
@@ -95,13 +95,18 @@
         </div>
       </div>
       <div class="login">已有账号?<a href="/">立即登录</a></div>
+      <loading v-show="isShowLoading"/>
     </div>
   </div>
 </template>
 
 <script>
+  import Loading from '~components/common/loading/Loading.vue'
   export default {
     name: 'EnterpriseRegistration',
+    components: {
+      Loading
+    },
     data () {
 //      企业注册第一步
       var validateMobile = (rule, value, callback) => {
@@ -196,26 +201,35 @@
         if (value === '') {
           callback(new Error('请填写正确的营业执照号'))
           this.businessCodeChecked = false
+          this.isBusinessCodeExist = false
         } else {
           if (this.enterprise1.businessCode !== '') {
-            if (value.length > 20) {
-              callback(new Error('输入长度过长,20个字符以内'))
-              this.businessCodeChecked = false
-            } else {
-              this.$http.get(`/api/userspace/checkBusinessCode`, {params: {businessCode: this.enterprise1.businessCode}})
-                .then(response => {
-                  if (response.data.success) {
-                    this.businessCodeChecked = true
-                    this.isBusinessCodeExist = false
-                  } else {
-                    this.businessCodeChecked = false
-                    this.isBusinessCodeExist = true
-                    return Promise.reject(response.data)
-                  }
-                }).catch(err => {
-                  console.log(err)
+            let reg = /^[0-9]*$/
+            if (reg.test(value)) {
+              if (value.length > 20) {
+                callback(new Error('输入长度过长,20个字符以内'))
+                this.businessCodeChecked = false
+                this.isBusinessCodeExist = false
+              } else {
+                this.$http.get(`/api/userspace/checkBusinessCode`, {params: {businessCode: this.enterprise1.businessCode}})
+                  .then(response => {
+                    if (response.data.success) {
+                      this.businessCodeChecked = true
+                      this.isBusinessCodeExist = false
+                    } else {
+                      this.businessCodeChecked = false
+                      this.isBusinessCodeExist = true
+                      return Promise.reject(response.data)
+                    }
+                  }).catch(err => {
+                    console.log(err)
 //                  this.$message.error(err.errMsg)
-                })
+                  })
+              }
+            } else {
+              callback(new Error('请填写正确的营业执照号'))
+              this.businessCodeChecked = false
+              this.isBusinessCodeExist = false
             }
           }
           callback()
@@ -362,6 +376,7 @@
           confirm: '',
           email: ''
         },
+        isShowLoading: false,
         checked: true,
         getCodeBtnIsDisabled: true,
         mobileChecked: false,
@@ -426,9 +441,11 @@
       },
 //      获取校验码
       getCheckCode () {
+        this.isShowLoading = true
         this.$http.get(`/sso/userspace/register/checkCode`, {params: {mobile: this.enterprise.mobile}})
           .then(response => {
             this.token = response.data.token
+            this.isShowLoading = false
             if (this.token !== '') {
               this.$message({
                 message: '验证码已经发送到您的手机,请注意查收',
@@ -449,8 +466,9 @@
           })
       },
 //      验证手机
-      CheckPhone () {
+      checkPhone () {
         if (this.mobileChecked && this.codeChecked && this.checked) {
+          this.isShowLoading = true
           var url = window.location.search
           var request = {}
           if (url.indexOf('?' !== -1)) {
@@ -472,6 +490,7 @@
           this.$http.post('/sso/userspace/register/checkAdminTel', param, config)
             .then(response => {
               if (response.data.success) {
+                this.isShowLoading = false
                 this.goNextStep = false
                 if (response.data.content.hasRegister) {
                   this.isHasRegister = true
@@ -495,6 +514,7 @@
       },
 //      确认注册
       sureRegister () {
+        this.isShowLoading = true
         if (!this.isHasRegister) {
           if (this.spaceNameChecked && this.businessCodeChecked && this.vipNameChecked && this.passwordChecked && this.passwordConfirmChecked && this.emailChecked && this.checked) {
             var url = window.location.search
@@ -520,7 +540,8 @@
             this.$http.post('/sso/userspace/register', param, config)
               .then(response => {
                 if (response.data.success) {
-
+                  this.isShowLoading = false
+                  window.location.href = '/overRegister/overEnterprise'
                 } else {
                   return Promise.reject(response.data)
                 }
@@ -544,7 +565,8 @@
               this.$http.post('/sso/userspace/register', param, config)
                 .then(response => {
                   if (response.data.success) {
-
+                    this.isShowLoading = false
+                    window.location.href = '/overRegister/overEnterprise'
                   } else {
                     return Promise.reject(response.data)
                   }
@@ -567,6 +589,7 @@
               this.$http.post('/sso/userspace/register', param, config)
                 .then(response => {
                   if (response.data.success) {
+                    this.isShowLoading = false
                     window.location.href = '/overRegister/overEnterprise'
                   } else {
                     return Promise.reject(response.data)
@@ -741,7 +764,7 @@
               }
               span.agree{
                 float: left;
-                margin: 0 0 0 10px;
+                margin: 1px 0 0 10px;
                 font-size: 14px;
                 color: #8b8b8b;
                 a{

+ 599 - 0
components/register/EnterpriseRegistrationSecondStep.vue

@@ -0,0 +1,599 @@
+<template>
+  <div class="register">
+    <div>
+      <el-form :model="enterprise1" :rules="rules1" ref="enterprise1" label-width="100px" class="demo-ruleForm">
+        <el-form-item prop="spaceName">
+          <el-input type="text"
+                    v-model="enterprise1.spaceName"
+                    v-bind:class="{ active: isSpaceNameExist }"
+                    auto-complete="off"
+                    placeholder="企业名称"
+          ></el-input>
+          <span class="tip exist" v-show="isSpaceNameExist">该企业已被注册,请确认。<a href="https://www.ubtob.com/contact">仍有问题?</a></span>
+        </el-form-item>
+        <el-form-item prop="businessCode">
+          <el-input type="text"
+                    v-model="enterprise1.businessCode"
+                    v-bind:class="{ active: isBusinessCodeExist }"
+                    auto-complete="off"
+                    placeholder="营业执照号"></el-input>
+          <span class="tip exist" v-show="isBusinessCodeExist">该企业已被注册,请确认。<a href="https://www.ubtob.com/contact">仍有问题?</a></span>
+        </el-form-item>
+        <el-form-item prop="vipName" v-if="!isHasRegister">
+          <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>
+          <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>
+          <div class="pwd low" v-show="showMsgTip4">密码强度 <em></em><em></em><em></em></div>
+        </el-form-item>
+        <el-form-item prop="password" v-if="isHasRegister">
+          <el-input type="password"
+                    v-model="enterprise1.password"
+                    auto-complete="off"
+                    placeholder="密码确认"
+                    v-bind:class="{ correct: this.passwordChecked }"></el-input>
+          <span class="sure" v-if="isHasRegister" v-show="phoneIsRegisterTip">手机号已注册,请输入原密码 <a>忘记密码?</a></span>
+        </el-form-item>
+        <el-form-item prop="confirm" v-if="!isHasRegister">
+          <el-input type="password"
+                    auto-complete="off"
+                    placeholder="密码确认"
+                    v-model="enterprise1.confirm"></el-input>
+        </el-form-item>
+        <el-form-item prop="email" v-if="!isHasEmail">
+          <el-input type="text" v-model="enterprise1.email" auto-complete="off" placeholder="联系邮箱"></el-input>
+        </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>
+        </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>
+        </el-form-item>
+      </el-form>
+    </div>
+  </div>
+</template>
+
+<script>
+  export default {
+    name: 'EnterpriseRegistrationSecondStep',
+    data () {
+//      企业注册第二步
+      var validateSpaceName = (rule, value, callback) => {
+        if (value === '') {
+          callback(new Error('请填写正确的企业名称'))
+          this.spaceNameChecked = false
+        } else {
+          if (this.enterprise1.spaceName !== '') {
+            if (value.length > 20) {
+              callback(new Error('输入长度过长,20个字符以内'))
+              this.spaceNameChecked = false
+            } else {
+              this.$http.get(`/api/userspace/checkSpaceName`, {params: {spaceName: this.enterprise1.spaceName}})
+                .then(response => {
+                  if (response.data.success) {
+                    this.spaceNameChecked = true
+                    this.isSpaceNameExist = false
+                  } else {
+                    this.spaceNameChecked = false
+                    this.isSpaceNameExist = true
+                    return Promise.reject(response.data)
+                  }
+                }).catch(err => {
+                  console.log(err)
+//                  this.$message.error(err.errMsg)
+                })
+            }
+          }
+          callback()
+        }
+      }
+      var validateBusinessCode = (rule, value, callback) => {
+        if (value === '') {
+          callback(new Error('请填写正确的营业执照号'))
+          this.businessCodeChecked = false
+        } else {
+          if (this.enterprise1.businessCode !== '') {
+            let reg = /^[0-9]*$/
+            if (reg.test(value)) {
+              if (value.length > 20) {
+                callback(new Error('输入长度过长,20个字符以内'))
+                this.businessCodeChecked = false
+                this.isBusinessCodeExist = false
+              } else {
+                this.$http.get(`/api/userspace/checkBusinessCode`, {params: {businessCode: this.enterprise1.businessCode}})
+                  .then(response => {
+                    if (response.data.success) {
+                      this.businessCodeChecked = true
+                      this.isBusinessCodeExist = false
+                    } else {
+                      this.businessCodeChecked = false
+                      this.isBusinessCodeExist = true
+                      return Promise.reject(response.data)
+                    }
+                  }).catch(err => {
+                    console.log(err)
+//                  this.$message.error(err.errMsg)
+                  })
+              }
+            } else {
+              callback(new Error('请填写正确的营业执照号'))
+              this.businessCodeChecked = false
+              this.isBusinessCodeExist = false
+            }
+          }
+          callback()
+        }
+      }
+      var validateVipName = (rule, value, callback) => {
+        if (this.isHasRegister) {
+          this.vipNameChecked = true
+        } else {
+          if (value === '') {
+            callback(new Error('请填写正确的管理员姓名'))
+            this.vipNameChecked = false
+          } else {
+            if (this.enterprise1.vipName !== '') {
+              if (value.length > 20) {
+                callback(new Error('输入长度过长,20个字符以内'))
+              } else {
+                this.vipNameChecked = true
+              }
+            }
+            callback()
+          }
+        }
+      }
+      var validatePassword = (rule, value, callback) => {
+        if (this.enterprise1.password !== '') {
+          if (value.length <= 20 && value.length >= 8) {
+            var reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
+            var reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
+            if (reg1.test(value)) {
+//                callback(new Error('密码强度强'))
+              this.showMsgTip3 = true
+              this.showMsgTip2 = false
+              this.showMsgTip1 = false
+              this.showMsgTip4 = false
+              this.passwordChecked = true
+            } else if (reg2.test(value)) {
+//                callback(new Error('密码强度中'))
+              this.showMsgTip2 = true
+              this.showMsgTip3 = false
+              this.showMsgTip1 = false
+              this.showMsgTip4 = false
+              this.passwordChecked = true
+            } else {
+              this.showMsgTip1 = true
+              this.showMsgTip3 = false
+              this.showMsgTip2 = false
+              this.showMsgTip4 = false
+              this.passwordChecked = false
+            }
+          } else {
+            this.showMsgTip3 = false
+            this.showMsgTip2 = false
+            this.showMsgTip1 = false
+            this.showMsgTip4 = true
+            this.passwordChecked = false
+          }
+        }
+        callback()
+      }
+      var validatePasswordTip = (rule, value, callback) => {
+        if (this.isHasRegister) {
+          if (value === '') {
+            callback(new Error('请输入密码'))
+            this.passwordChecked = false
+            this.phoneIsRegisterTip = false
+          } else {
+            this.passwordChecked = true
+          }
+        } else {
+          if (value === '') {
+            callback(new Error('请输入密码'))
+            this.passwordChecked = false
+          } else {
+            if (this.enterprise1.password !== '') {
+              if (value.length <= 20 && value.length >= 8) {
+                var reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
+                var reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
+                if (reg1.test(value)) {
+                  this.passwordChecked = true
+                } else if (reg2.test(value)) {
+                  this.passwordChecked = true
+                } else {
+                  callback(new Error('密码须为8-20字符的英文、数字混合'))
+                  this.passwordChecked = false
+                }
+              } else {
+                callback(new Error('密码须为8-20字符的英文、数字混合'))
+                this.passwordChecked = false
+              }
+            }
+            callback()
+          }
+        }
+      }
+      var validateConfirm = (rule, value, callback) => {
+        if (this.isHasRegister) {
+          this.passwordConfirmChecked = true
+        } else {
+          if (value === '') {
+            callback(new Error('请再次输入密码'))
+            this.passwordConfirmChecked = false
+          } else if (value !== this.enterprise1.password) {
+            callback(new Error('两次输入密码不一致!'))
+          } else {
+            this.passwordConfirmChecked = true
+            callback()
+          }
+        }
+      }
+      var validateEmail = (rule, value, callback) => {
+        if (this.isHasEmail) {
+          this.emailChecked = true
+        } else {
+          if (!value) {
+            callback(new Error('请填写正确的联系邮箱'))
+            this.emailChecked = 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
+              } else {
+                this.emailChecked = true
+              }
+            }
+            callback()
+          }
+        }
+      }
+      return {
+//        企业注册第二步
+        enterprise1: {
+          spaceName: '',
+          businessCode: '',
+          vipName: '',
+          password: '',
+          confirm: '',
+          email: ''
+        },
+        checked: true,
+        codeChecked: false,
+        enterprise_time: 0,
+        showMsgTip1: false,
+        showMsgTip2: false,
+        showMsgTip3: false,
+        showMsgTip4: false,
+        spaceNameChecked: false,
+        businessCodeChecked: false,
+        vipNameChecked: false,
+        passwordChecked: false,
+        passwordConfirmChecked: false,
+        emailChecked: false,
+        isHasRegister: false,
+        isHasEmail: false,
+        phoneIsRegisterTip: true,
+        isSpaceNameExist: false,
+        isBusinessCodeExist: false,
+//        企业注册第二步
+        rules1: {
+          spaceName: [
+            {validator: validateSpaceName, trigger: 'blur'}
+          ],
+          businessCode: [
+            {validator: validateBusinessCode, trigger: 'blur'}
+          ],
+          vipName: [
+            {validator: validateVipName, trigger: 'blur'}
+          ],
+          password: [
+            {validator: validatePassword, trigger: 'change'},
+            {validator: validatePasswordTip, trigger: 'blur'}
+          ],
+          confirm: [
+            {validator: validateConfirm, trigger: 'blur'}
+          ],
+          email: [
+            {validator: validateEmail, trigger: 'blur'}
+          ]
+        }
+      }
+    },
+    methods: {
+//      我同意是否被选中
+      checkboxIsChecked () {
+        this.checked = !this.checked
+      },
+//      确认注册
+      sureRegister () {
+        if (!this.isHasRegister) {
+          if (this.spaceNameChecked && this.businessCodeChecked && this.vipNameChecked && this.passwordChecked && this.passwordConfirmChecked && this.emailChecked && this.checked) {
+            var url = window.location.search
+            var request = {}
+            if (url.indexOf('?' !== -1)) {
+              var str = url.substr(1)
+              var strs = str.split('&')
+              for (var i = 0; i < strs.length; i++) {
+                request[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1])
+              }
+            }
+            var appId = request['appId'] || ''
+            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', appId)
+            let config = {
+              headers: {'Content-Type': 'multipart/form-data'}
+            }
+            this.$http.post('/sso/userspace/register', param, config)
+              .then(response => {
+                if (response.data.success) {
+
+                } else {
+                  return Promise.reject(response.data)
+                }
+              }).catch(err => {
+                this.$message.error(err.errMsg)
+              })
+          }
+        } else {
+          if (this.isHasEmail) {
+            if (this.spaceNameChecked && this.businessCodeChecked && this.passwordChecked) {
+              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', appId)
+              let config = {
+                headers: {'Content-Type': 'multipart/form-data'}
+              }
+              this.$http.post('/sso/userspace/register', param, config)
+                .then(response => {
+                  if (response.data.success) {
+
+                  } else {
+                    return Promise.reject(response.data)
+                  }
+                }).catch(err => {
+                  this.$message.error(err.errMsg)
+                })
+            }
+          } else {
+            if (this.spaceNameChecked && this.businessCodeChecked && this.passwordChecked && this.emailChecked) {
+              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', appId)
+              let config = {
+                headers: {'Content-Type': 'multipart/form-data'}
+              }
+              this.$http.post('/sso/userspace/register', param, config)
+                .then(response => {
+                  if (response.data.success) {
+                    window.location.href = '/overRegister/overEnterprise'
+                  } else {
+                    return Promise.reject(response.data)
+                  }
+                }).catch(err => {
+                  this.$message.error(err.errMsg)
+                })
+            }
+          }
+        }
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .register {
+    margin: 0 auto;
+    width: 100%;
+    background: #fff;
+    .container{
+      padding-top: 50px;
+      margin: 0 auto;
+      width: 980px;
+      text-align: center;
+      .content{
+        padding: 0 50px;
+        margin: 50px auto 0;
+        width: 100%;
+        text-align: center;
+        background: #fff;
+          .content-top{
+            height: 80px;
+            line-height: 80px;
+            border-bottom: 1px solid #dcdcdc;
+            h3{
+              font-family: 'SimHei';
+              font-size: 24px;
+              color: #000;
+            }
+          }
+          form {
+            padding-bottom: 44px;
+            margin-top: 35px;
+              span.sure{
+                position: absolute;
+                top: 0;
+                right: -240px;
+                font-size: 13px;
+                color: #8c8c8c;
+              }
+              span.codeError-tip{
+                position: absolute;
+                top: 3px;
+                right: -105px;
+                color: #ff4949;
+                font-size: 12px;
+              }
+              input{
+                padding: 0 0 0 18px;
+                width: 360px;
+                height: 44px;
+                line-height: 44px;
+                font-size: 14px;
+                color: #000;
+                border-radius: 0;
+              }
+              i{
+                position: absolute;
+                top: 10px;
+                right: 18px;
+                font-size: 24px;
+                color: #a0a0a0;
+                cursor: pointer;
+              }
+              .pwd {
+                margin: 6px 0 -15px 0;
+                text-align: left;
+                font-size: 13px;
+              em{
+                display: inline-block;
+                margin: 0 8px 2px 0;
+                width: 24px;
+                height: 6px;
+              &:first-child{
+                 margin-left: 10px;
+               }
+              }
+              span{
+                margin-left: 10px;
+                font-size: 13px;
+              }
+              }
+              .pwd.sm{
+                color: #8c8c8c;
+              em {
+                background: #bfbfbf;
+              &:first-child{
+                 background: #ff4e00;
+               }
+              }
+              span{
+                color: #ff4e00;
+              }
+              }
+              .pwd.md{
+                color: #8c8c8c;
+              em {
+                background: #22ac38;
+              &:nth-child(3){
+                 background: #bfbfbf;
+               }
+              }
+              span{
+                color: #22ac38;
+              }
+              }
+              .pwd.lar{
+                color: #8c8c8c;
+              em {
+                background: #00a0e9;
+              }
+              span{
+                color: #00a0e9;
+              }
+              }
+              .pwd.low{
+                color: #8c8c8c;
+              em {
+                background: #bfbfbf;
+              }
+              span{
+                color: #00a0e9;
+              }
+              }
+              span.tip{
+                position: absolute;
+                top: 0;
+                right: -165px;
+                font-size: 13px;
+                color: #8c8c8c;
+              }
+              span.tip.exist{
+                right: -239px;
+                a{
+                  color: #2d8cf0;
+                }
+              }
+              input.msg{
+                float: left;
+                width: 210px;
+              }
+              span.msg{
+                float: right;
+                width: 130px;
+                height: 44px;
+                line-height: 44px;
+                font-size: 14px;
+                color: #5a5a5a;
+                background: #f4f4f4;
+                border: 1px solid #dcdcdc;
+                cursor: pointer;
+              }
+              span.msg.send{
+                background: #d2d2d2;
+                color: #fff;
+              }
+              input[type='checkbox']{
+                margin: 0 14px 0 55px;
+                float: left;
+                width: 16px;
+                height: 16px;
+              }
+              span.agree{
+                float: left;
+                margin: 0 0 0 10px;
+                font-size: 14px;
+                color: #8b8b8b;
+                a{
+                  color: #0076ad;
+                }
+              }
+              .form-group.agree{
+                margin: 20px auto 0 !important;
+              }
+              .btn {
+                margin: 34px 0 16px 0;
+                width: 360px;
+                height: 44px;
+                line-height: 44px;
+                font-size: 16px;
+                color: #fff;
+                background: #0076AD;
+                border-radius: 3px;
+              }
+              }
+              }
+            .login{
+              margin-top: 20px;
+              font-size: 14px;
+              color: #8c8c8c;
+              a{
+                font-size: 14px;
+                color: #0076ad;
+              }
+            }
+    }
+  }
+</style>

+ 10 - 0
components/register/PersonalRegistration.vue

@@ -51,13 +51,18 @@
         </div>
       </div>
       <div class="login">已有账号?<a href="/">立即登录</a></div>
+      <loading v-show="isShowLoading"/>
     </div>
   </div>
 </template>
 
 <script>
+  import Loading from '~components/common/loading/Loading.vue'
   export default {
     name: 'PersonalRegistration',
+    components: {
+      Loading
+    },
     data () {
       var validateName = (rule, value, callback) => {
         if (value === '') {
@@ -228,6 +233,7 @@
           mobile: '',
           code: ''
         },
+        isShowLoading: false,
         vipNameChecked: false,
         passwordChecked: false,
         confirmChecked: false,
@@ -273,6 +279,7 @@
       },
 //      表单提交
       submit () {
+        this.isShowLoading = true
         if (this.vipNameChecked && this.passwordChecked && this.confirmChecked && this.mobileChecked && this.codeChecked && this.checked) {
           var url = window.location.search
           var request = {}
@@ -298,6 +305,7 @@
           this.$http.post('/sso/personal/register', param, config)
             .then(response => {
               if (response.data.success) {
+                this.isShowLoading = false
                 window.location.href = '/overRegister/overPersonal'
               } else {
                 return Promise.reject(response.data)
@@ -313,9 +321,11 @@
 //        this.token = data.token
 //      },
       getCheckCode () {
+        this.isShowLoading = true
 //        this.getCode()
         this.$http.get(`/sso/personal/register/checkCode`, {params: {mobile: this.item.mobile}})
           .then(response => {
+            this.isShowLoading = false
             this.token = response.data.token
             if (this.token !== '') {
               this.$message({

+ 14 - 0
components/reset/ChangePasswordChooseStyle.vue

@@ -112,13 +112,18 @@
           </div>
         </div>
       </div>
+      <loading v-show="isShowLoading"/>
     </div>
   </div>
 </template>
 
 <script>
+  import Loading from '~components/common/loading/Loading.vue'
   export default {
     name: 'validation',
+    components: {
+      Loading
+    },
     data () {
 //      第一步校验验证码
       var validateFirstCode = (rule, value, callback) => {
@@ -169,6 +174,7 @@
         }
       }
       return {
+        isShowLoading: false,
         goFirstStep: true,
         showManualAppeal: false,
         hasValidPasswordWay: true,
@@ -285,8 +291,10 @@
       },
 //      获取第一步手机验证码
       getCheckCode () {
+        this.isShowLoading = true
         this.$http.get(`/sso/resetPwd/check/mobile`)
           .then(response => {
+            this.isShowLoading = false
             this.token = response.data.content.token
             if (this.token !== '') {
               this.$message({
@@ -309,6 +317,7 @@
       },
 //      原密码验证
       goPasswordNextStep () {
+        this.isShowLoading = true
         if (this.oldPasswordChecked) {
           let param = new FormData()
           param.append('password', this.valid1.password)
@@ -318,6 +327,7 @@
           this.$http.post(`/sso/resetPwd/check/password`, param, config)
             .then(response => {
               if (response.data.success) {
+                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content.token)
                 this.showPhoneValid = false
                 this.$router.push({ path: '/reset/passwordResetValidQuestion' })
@@ -332,6 +342,7 @@
       },
 //      手机号验证下一步
       goNextStep () {
+        this.isShowLoading = true
         if (this.codeChecked) {
           let param = new FormData()
           param.append('code', this.valid.code)
@@ -342,6 +353,7 @@
           this.$http.post(`/sso/resetPwd/check/mobile`, param, config)
             .then(response => {
               if (response.data.success) {
+                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content.token)
                 this.showPhoneValid = false
                 this.$router.push({ path: '/reset/passwordResetValidQuestion' })
@@ -356,9 +368,11 @@
       },
 //      第一步验证邮箱
       firstStepValidEmail () {
+        this.isShowLoading = true
         this.$http.get(`/sso/resetPwd/check/email`)
           .then(response => {
             if (response.data.success) {
+              this.isShowLoading = false
               this.emailSendSuccess = true
             } else {
               this.emailSendSuccess = false

+ 12 - 0
components/reset/ForgetPasswordChooseStyle.vue

@@ -81,13 +81,18 @@
           </div>
         </div>
       </div>
+      <loading v-show="isShowLoading"/>
     </div>
   </div>
 </template>
 
 <script>
+  import Loading from '~components/common/loading/Loading.vue'
   export default {
     name: 'validation',
+    components: {
+      Loading
+    },
     data () {
 //      第一步校验验证码
       var validateFirstCode = (rule, value, callback) => {
@@ -126,6 +131,7 @@
         }
       }
       return {
+        isShowLoading: false,
         goFirstStep: true,
         showManualAppeal: false,
         hasValidPhoneWay: false,
@@ -209,8 +215,10 @@
       },
       //      获取第一步手机验证码
       getCheckCode () {
+        this.isShowLoading = true
         this.$http.get(`/sso/resetPwd/check/mobile`)
           .then(response => {
+            this.isShowLoading = false
             this.token = response.data.content.token
             if (this.token !== '') {
               this.$message({
@@ -233,6 +241,7 @@
       },
 //      手机号验证下一步
       goNextStep () {
+        this.isShowLoading = true
         if (this.codeChecked) {
           let param = new FormData()
           param.append('code', this.valid.code)
@@ -243,6 +252,7 @@
           this.$http.post(`/sso/resetPwd/check/mobile`, param, config)
             .then(response => {
               if (response.data.success) {
+                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content.token)
                 this.showPhoneValid = false
                 this.$router.push({ path: '/reset/passwordResetValidQuestion' })
@@ -257,9 +267,11 @@
       },
 //      第一步验证邮箱
       firstStepValidEmail () {
+        this.isShowLoading = true
         this.$http.get(`/sso/resetPwd/check/email`)
           .then(response => {
             if (response.data.success) {
+              this.isShowLoading = false
               this.emailSendSuccess = true
             } else {
               this.emailSendSuccess = false

+ 8 - 0
components/reset/ForgetPasswordValidationAccount.vue

@@ -25,13 +25,18 @@
           </el-form>
         </div>
       </div>
+      <loading v-show="isShowLoading"/>
     </div>
   </div>
 </template>
 
 <script>
+  import Loading from '~components/common/loading/Loading.vue'
   export default {
     name: 'reset',
+    components: {
+      Loading
+    },
     data () {
       var validateMobile = (rule, value, callback) => {
         if (value === '') {
@@ -66,6 +71,7 @@
           mobile: '',
           captcha: ''
         },
+        isShowLoading: false,
         mobileChecked: false,
         captchaChecked: false,
         rules: {
@@ -80,6 +86,7 @@
     },
     methods: {
       sureAccount () {
+        this.isShowLoading = true
         if (this.mobileChecked && this.captchaChecked) {
           let param = new FormData()
           param.append('mobile', this.valid.mobile)
@@ -90,6 +97,7 @@
           this.$http.post(`/sso/resetPwd/checkCaptcha`, param, config)
             .then(response => {
               if (response.data.success) {
+                this.isShowLoading = false
                 this.$router.push({ path: '/reset/forgetPasswordChooseStyle' })
               } else {
                 this.changeCaptcha()

+ 31 - 3
components/reset/PasswordResetNewPassword.vue

@@ -19,7 +19,12 @@
               <div class="pwd low" v-show="showMsgTip4">密码强度 <em></em><em></em><em></em></div>
             </el-form-item>
             <el-form-item prop="confirm">
-              <el-input type="password" v-model="newPassword.confirm" auto-complete="off" placeholder="确认密码"></el-input>
+              <el-input type="password"
+                        v-model="newPassword.confirm"
+                        v-bind:class="{active: showPasswordError}"
+                        auto-complete="off"
+                        placeholder="确认密码"></el-input>
+              <span class="tip passwordError" v-show="showPasswordError">两次输入密码不一致</span>
             </el-form-item>
             <el-form-item>
               <a class="btn finish"
@@ -29,13 +34,18 @@
           </el-form>
         </div>
       </div>
+      <loading v-show="isShowLoading"/>
     </div>
   </div>
 </template>
 
 <script>
+  import Loading from '~components/common/loading/Loading.vue'
   export default {
     name: 'validation',
+    components: {
+      Loading
+    },
     data () {
 //      验证密保
       var validatePassword = (rule, value, callback) => {
@@ -95,23 +105,39 @@
               callback(new Error('密码须为8-20字符的英文、数字混合'))
               this.passwordChecked = false
             }
+            if (this.newPassword.confirm !== '') {
+              if (value !== this.newPassword.confirm) {
+                this.showPasswordError = true
+                // callback(new Error('两次输入密码不一致!'))
+                this.confirmChecked = false
+              } else {
+                this.confirmChecked = true
+                this.showPasswordError = false
+                callback()
+              }
+            }
           }
           callback()
         }
       }
       var validateConfirm = (rule, value, callback) => {
+        console.log(callback)
         if (value === '') {
           callback(new Error('请再次输入密码'))
           this.confirmChecked = false
         } else if (value !== this.newPassword.password) {
-          callback(new Error('两次输入密码不一致!'))
+          // callback(new Error('两次输入密码不一致!'))
+          this.showPasswordError = true
           this.confirmChecked = false
         } else {
+          this.showPasswordError = false
           this.confirmChecked = true
           callback()
         }
       }
       return {
+        showPasswordError: false,
+        isShowLoading: false,
         showMsgTip1: false,
         showMsgTip2: false,
         showMsgTip3: false,
@@ -153,6 +179,7 @@
     },
     methods: {
       passwordSubmit () {
+        this.isShowLoading = true
         if (this.passwordChecked && this.confirmChecked) {
           let param = new FormData()
           param.append('password', this.newPassword.password)
@@ -163,6 +190,7 @@
           this.$http.post(`/sso/resetPwd`, param, config)
             .then(response => {
               if (response.data.success) {
+                this.isShowLoading = false
                 this.$router.push({ path: '/reset/passwordResetSetSuccess' })
               } else {
                 return Promise.reject(response.data)
@@ -323,7 +351,7 @@
     color: #0076ad;
   }
   }
-  span.tip.codeError-tip{
+  span.tip.passwordError{
     position: absolute;
     top: 3px;
     left: 378px;

+ 16 - 0
components/reset/PasswordResetValidQuestion.vue

@@ -35,13 +35,18 @@
           </el-form>
         </div>
       </div>
+      <loading v-show="isShowLoading"/>
     </div>
   </div>
 </template>
 
 <script>
+  import Loading from '~components/common/loading/Loading.vue'
   export default {
     name: 'validation',
+    components: {
+      Loading
+    },
     data () {
 //      验证密保
       var validateSecondAnswer1 = (rule, value, callback) => {
@@ -67,6 +72,7 @@
         }
       }
       return {
+        isShowLoading: false,
         getQuestions: '',
         question1: '',
         question2: '',
@@ -125,17 +131,26 @@
         this.$http.get('/sso/resetPwd/check/question', {params: {token: this.firstStepToken}})
           .then(response => {
             if (response.data.success) {
+              if (response.data.content.questions.length === 0) {
+                this.$router.push({ path: '/reset/passwordResetNewPassword' })
+              }
+              console.log(response.data.content.questions)
               this.getQuestions = response.data.content.questions
               this.question1 = this.getQuestions[0].question
               this.question2 = this.getQuestions[1].question
               this.id1 = this.getQuestions[0].id
               this.id2 = this.getQuestions[1].id
               this.questionToken = response.data.content.token
+            } else {
+              return Promise.reject(response.data)
             }
+          }).catch(err => {
+            console.log(err)
           })
       },
 //      第一步验证密保提交
       validQuestionSubmit () {
+        this.isShowLoading = true
         if (this.answer1SecondChecked && this.answer2SecondChecked) {
           let param = new FormData()
           let answer = []
@@ -150,6 +165,7 @@
           this.$http.post(`/sso/resetPwd/check/question`, param, config)
             .then(response => {
               if (response.data.success) {
+                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content.token)
                 this.$router.push({ path: '/reset/passwordResetNewPassword' })
               } else {

+ 14 - 0
components/validation/EmailValidation.vue

@@ -133,12 +133,17 @@
           </div>
         </el-dialog>
       </div>
+      <loading v-show="isShowLoading"/>
     </div>
   </div>
 </template>
 <script>
+  import Loading from '~components/common/loading/Loading.vue'
   export default {
     name: 'validation',
+    components: {
+      Loading
+    },
     data () {
 //      第一步校验验证码
       var validateFirstCode = (rule, value, callback) => {
@@ -200,6 +205,7 @@
         }
       }
       return {
+        isShowLoading: false,
         goFirstStep: true,
         hasValidPhoneWay: false,
         hasValidQuestionsWay: false,
@@ -349,8 +355,10 @@
       },
 //      获取第一步手机验证码
       getCheckCode () {
+        this.isShowLoading = true
         this.$http.get(`/update/user/check/mobile`, {params: {mobile: this.getMobile}})
           .then(response => {
+            this.isShowLoading = false
             this.token = response.data.content.token
             if (this.token !== '') {
               this.$message({
@@ -373,6 +381,7 @@
       },
 //      手机号验证下一步
       goNextStep () {
+        this.isShowLoading = true
         if (this.codeChecked) {
           let param = new FormData()
           param.append('mobile', this.getMobile)
@@ -384,6 +393,7 @@
           this.$http.post(`/update/user/check/mobile`, param, config)
             .then(response => {
               if (response.data.success) {
+                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content)
                 this.showPhoneValid = false
                 this.$router.push({ path: '/validation/emailValidationSecondStep' })
@@ -398,9 +408,11 @@
       },
 //      第一步验证邮箱
       firstStepValidEmail () {
+        this.isShowLoading = true
         this.$http.get(`/update/user/check/email`, {params: {email: this.getEmail, operate: 'email'}})
           .then(response => {
             if (response.data.success) {
+              this.isShowLoading = false
               this.emailSendSuccess = true
             } else {
               this.emailSendSuccess = false
@@ -413,6 +425,7 @@
       },
 //      第一步验证密保提交
       validQuestionSubmit () {
+        this.isShowLoading = true
         if (this.answer1SecondChecked && this.answer2SecondChecked) {
           let param = new FormData()
           let answer = []
@@ -425,6 +438,7 @@
           this.$http.post(`/update/user/check/question`, param, config)
             .then(response => {
               if (response.data.success) {
+                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content.token)
                 this.showQuestionsValid = false
                 this.$router.push({ path: '/validation/emailValidationSecondStep' })

+ 8 - 0
components/validation/EmailValidationSecondStep.vue

@@ -28,13 +28,18 @@
           </div>
         </div>
       </div>
+      <loading v-show="isShowLoading"/>
     </div>
   </div>
 </template>
 
 <script>
+  import Loading from '~components/common/loading/Loading.vue'
   export default {
     name: 'validation',
+    components: {
+      Loading
+    },
     data () {
 //      第二步验证手机
       var validateSecondEmail = (rule, value, callback) => {
@@ -55,6 +60,7 @@
         }
       }
       return {
+        isShowLoading: false,
         sendEmailSuccess: false,
         emailSecondChecked: false,
         valid2: {
@@ -81,10 +87,12 @@
     methods: {
 //      设置新邮箱
       sendVerificationRequest () {
+        this.isShowLoading = true
         if (this.emailSecondChecked) {
           this.$http.get(`/update/user/setEmail`, {params: {email: this.valid2.email, token: this.firstStepToken}})
             .then(response => {
               if (response.data.success) {
+                this.isShowLoading = false
                 this.sendEmailSuccess = true
               } else {
                 this.sendEmailSuccess = false

+ 14 - 0
components/validation/PhoneValidation.vue

@@ -121,13 +121,18 @@
           </el-form>
         </div>
       </div>
+      <loading v-show="isShowLoading"/>
     </div>
   </div>
 </template>
 
 <script>
+  import Loading from '~components/common/loading/Loading.vue'
   export default {
     name: 'validation',
+    components: {
+      Loading
+    },
     data () {
 //      第一步校验验证码
       var validateFirstCode = (rule, value, callback) => {
@@ -189,6 +194,7 @@
         }
       }
       return {
+        isShowLoading: false,
         goFirstStep: true,
         hasValidPhoneWay: false,
         hasValidQuestionsWay: false,
@@ -332,8 +338,10 @@
       },
 //      获取第一步手机验证码
       getCheckCode () {
+        this.isShowLoading = true
         this.$http.get(`/update/user/check/mobile`, {params: {mobile: this.getMobile}})
           .then(response => {
+            this.isShowLoading = false
             this.token = response.data.content.token
             if (this.token !== '') {
               this.$message({
@@ -356,6 +364,7 @@
       },
 //      手机号验证下一步
       goNextStep () {
+        this.isShowLoading = true
         if (this.codeChecked) {
           let param = new FormData()
           param.append('mobile', this.getMobile)
@@ -367,6 +376,7 @@
           this.$http.post(`/update/user/check/mobile`, param, config)
             .then(response => {
               if (response.data.success) {
+                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content)
                 this.showPhoneValid = false
                 this.$router.push({ path: '/validation/phoneValidationSecondStep' })
@@ -381,9 +391,11 @@
       },
 //      第一步验证邮箱
       firstStepValidEmail () {
+        this.isShowLoading = true
         this.$http.get(`/update/user/check/email`, {params: {email: this.getEmail, operate: 'mobile'}})
           .then(response => {
             if (response.data.success) {
+              this.isShowLoading = false
               this.emailSendSuccess = true
             } else {
               this.emailSendSuccess = false
@@ -396,6 +408,7 @@
       },
 //      第一步验证密保提交
       validQuestionSubmit () {
+        this.isShowLoading = true
         if (this.answer1SecondChecked && this.answer2SecondChecked) {
           let param = new FormData()
           let answer = []
@@ -408,6 +421,7 @@
           this.$http.post(`/update/user/check/question`, param, config)
             .then(response => {
               if (response.data.success) {
+                this.isShowLoading = false
                 this.$store.commit('login/GET_TOKEN', response.data.content.token)
                 this.showQuestionsValid = false
                 this.$router.push({ path: '/validation/phoneValidationSecondStep' })

+ 10 - 0
components/validation/PhoneValidationSecondStep.vue

@@ -37,13 +37,18 @@
           </div>
         </div>
       </div>
+      <loading v-show="isShowLoading"/>
     </div>
   </div>
 </template>
 
 <script>
+  import Loading from '~components/common/loading/Loading.vue'
   export default {
     name: 'validation',
+    components: {
+      Loading
+    },
     data () {
 //      第二步验证手机
       var validateSecondMobile = (rule, value, callback) => {
@@ -102,6 +107,7 @@
         }
       }
       return {
+        isShowLoading: false,
         second_step_time: 0,
         codeErrorChecked: false,
         secondStepCodeErrorChecked: false,
@@ -138,8 +144,10 @@
     methods: {
 //      获取第二步手机验证码
       getSecondCheckCode () {
+        this.isShowLoading = true
         this.$http.get(`/update/user/setMobile`, {params: {mobile: this.valid2.mobile, token: this.firstStepToken}})
           .then(response => {
+            this.isShowLoading = false
             this.secondToken = response.data.content.token
             if (this.secondToken !== '') {
               this.$message({
@@ -162,6 +170,7 @@
       },
 //      设置新手机号
       setNewMobile () {
+        this.isShowLoading = true
         if (this.mobileSecondChecked && this.secondCodeChecked) {
           let param = new FormData()
           param.append('mobile', this.valid2.mobile)
@@ -173,6 +182,7 @@
           this.$http.post(`/update/user/setMobile`, param, config)
             .then(response => {
               if (response.data.success) {
+                this.isShowLoading = false
                 this.$router.push({ path: '/validation/phoneValidationThirdStep' })
               } else {
                 return Promise.reject(response.data)

+ 1 - 1
nuxt.config.js

@@ -25,7 +25,7 @@ module.exports = {
   /*
   ** Customize the progress-bar color
   */
-  loading: { color: '#3B8070' },
+  loading: '~components/common/nuxt-loading/Loading.vue',
   /*
   ** Build configuration
   */

+ 2 - 2
pages/cloudcenter/enterprise/index.vue

@@ -82,7 +82,7 @@
       </div>
     </template>
     <template>
-      <el-dialog
+      <el-dialog class="center"
         title="温馨提示"
         :visible.sync="centerDialogVisible"
         width="30%"
@@ -120,7 +120,7 @@
       }
     },
     created: function () {
-      // this.user.userspace ? this.centerDialogVisible = false : this.centerDialogVisible = true
+      this.user.userspace ? this.centerDialogVisible = false : this.centerDialogVisible = true
     },
     computed: {
       user () {

+ 17 - 0
pages/emailLinkPage/index.vue

@@ -0,0 +1,17 @@
+<template>
+  <div>
+    <accountCenter-header/>
+    <emailLink-page/>
+  </div>
+</template>
+<script>
+  import AccountCenterHeader from '~components/default/AccountCenterHeader.vue'
+  import EmailLinkPage from '~components/default/EmailLinkPage.vue'
+  export default {
+    layout: 'default',
+    components: {
+      AccountCenterHeader,
+      EmailLinkPage
+    }
+  }
+</script>

BIN
static/images/all/loading.gif