Browse Source

新账号中心登录功能和企业注册第一步

hangb 7 years ago
parent
commit
8f1795bec4

+ 1 - 1
app.html

@@ -3,7 +3,7 @@
 <head>
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css"/>
-  <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/element-ui/1.3.7/theme-default/index.css"/>
+  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
   <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_0d1jjt5tukcblnmi.css"/>
   {{ HEAD }}
   <script>

+ 192 - 0
assets/scss/common.scss

@@ -275,3 +275,195 @@ a {
 .select-adder::-ms-expand {
   display: none;
 }
+
+//按钮不可点击状态
+.el-button.is-disabled, .el-button.is-disabled:focus, .el-button.is-disabled:hover {
+  color: #bfcbd9 !important ;
+  cursor: not-allowed !important ;
+  background-image: none !important ;
+  background-color: #eef1f6 !important ;
+  border-color: #d1dbe5 !important ;
+}
+//每项最后一步按钮不可点击状态
+.el-button.finish.is-disabled, .el-button.finish.is-disabled:focus, .el-button.finish.is-disabled:hover {
+  color: #fff !important;
+  background-color: #0076AD !important;
+  border: none !important;
+  opacity: .7;
+  cursor: not-allowed !important;
+}
+//隐藏加载数据状态
+.el-input__icon{
+  display: none;
+}
+//表单样式
+form .el-form-item {
+  margin: 0 auto 16px;
+  width: 360px;
+}
+form .el-form-item:last-child {
+  margin: -8px auto 0!important;
+}
+form .el-form-item .el-form-item__content {
+  margin-left: 0 !important;
+}
+form .el-form-item .el-form-item__content .el-input__inner{
+  padding: 0 0 0 18px;
+  width: 360px;
+  height: 44px;
+  line-height: 44px;
+  font-size: 14px;
+  color: #000;
+  border-radius: 0;
+}
+form .el-form-item .el-form-item__content .msg{
+  float: left;
+  width: 210px;
+}
+form .el-form-item .el-form-item__content .msg .el-input__inner{
+  width: 210px;
+}
+form .el-form-item .el-form-item__content .code{
+  float: right;
+  width: 130px;
+  height: 44px;
+  font-size: 14px;
+  color: #5a5a5a;
+  background: #f4f4f4;
+  border: 1px solid #dcdcdc;
+  border-radius: 0;
+  cursor: pointer;
+}
+form .el-form-item .el-form-item__content .el-form-item__error {
+  position: absolute;
+  top: 15px;
+  left: 380px;
+  padding-top: 0;
+  width: 100%;
+  text-align: left;
+}
+form .el-form-item .el-form-item__content .finish{
+  display: inline-block;
+  margin-top: 34px;
+  width: 360px;
+  height: 44px;
+  line-height: 44px;
+  font-size: 16px;
+  color: #fff;
+  background: #0076AD;
+  border-radius: 3px;
+  border: none;
+}
+form .el-form-item .el-form-item__content .el-checkbox{
+  float: left;
+  margin-left: 50px;
+}
+form .el-form-item .el-form-item__content .el-checkbox .el-checkbox__inner{
+  width: 16px;
+  height: 16px;
+  border: 1px solid #ccc;
+  border-radius: 0;
+}
+
+//我同意按钮
+.el-checkbox__input.is-checked .el-checkbox__inner{
+  background: transparent !important;
+  border-color: #bfbfbf !important;
+}
+.el-checkbox__input.is-focus .el-checkbox__inner{
+  border-color: #bfbfbf !important;
+}
+.el-checkbox__inner{
+  border-color: #bfbfbf !important;
+}
+.el-checkbox__inner::after{
+  border: 2px solid #0076AD !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 {
+  border-color: #ccc!important;
+}
+.login-form .el-input__inner{
+  padding-left: 30px !important;
+  width: 306px !important;
+  height: 34px !important;
+  line-height: 34px !important;
+}
+.login-form .el-form-item{
+  position: relative;
+  width: 306px !important;
+}
+.login-form .el-form-item i.fa{
+  position: absolute;
+  top: 4px;
+  left: 0;
+  z-index: 2;
+  display: block;
+  width: 30px;
+  height: 34px;
+  line-height: 34px;
+  text-align: center;
+  pointer-events: none;
+  color: #999;
+  font-size: 18px;
+}
+.login-form .captcha{
+  overflow: hidden;
+}
+.login-form .code-input{
+  float: left;
+  width: 150px !important;
+}
+.login-form .code-input .el-input__inner{
+  padding: 0 !important;
+  height: 34px !important;
+  line-height: 34px !important;
+  width: 150px !important;
+}
+.login-form img.code-img{
+  margin-top: 5px;
+  float: left;
+  height: 30px;
+  width: 108px;
+}
+.login-form a.code-click{
+  float: right;
+  display: inline-block;
+  margin-top: 5px;
+  width: 45px;
+  line-height: 15px;
+  text-align: right;
+  font-size: 12px;
+  color: #666;
+  vertical-align: middle;
+  cursor: pointer;
+}
+.login-form a.code-click:hover{
+  color: #5078cb;
+  text-decoration: none;
+  outline: 0;
+}
+.login-form .el-form-item a.forget{
+  color: #5078cb;
+  font-size: 12px;
+}
+.login-form .el-form-item.text-right{
+}
+.login-form .text-right .el-form-item__content{
+  height: 20px;
+  line-height: 16px;
+}
+.login-form .el-form-item .login{
+  width: 306px;
+  height: 34px;
+  line-height: 30px;
+}
+
+//个人注册
+form .el-form-item .el-form-item__content div.active .el-input__inner{
+  border-color: #f56c6c !important;
+}

+ 0 - 2
components/default/LoginHeader.vue

@@ -3,11 +3,9 @@
     <div class="container">
       <div class="navbar-header">
         <input type="hidden" name="iconUrl" value="/static/img/icon_mall_index.png">
-
         <a class="navbar-brand" href="https://www.usoftmall.com/">
           欢迎登录
         </a>
-
       </div>
       <div class="collapse navbar-collapse navbar-right">
         <a href="http://www.ubtob.com">优软云首页</a> <a href="http://uas.ubtob.com/serve#/">帮助</a>

+ 163 - 33
components/login/Login.vue

@@ -20,43 +20,35 @@
     <div class="x-login-wrap">
       <div class="x-login">
         <!-- user & pwd login wrap -->
-        <div id="form-wrap" class="x-login-form" autocomplete="on">
-          <form name="loginForm">
-            <input type="hidden" name="appId" value="home">
-            <input type="hidden" name="returnUrl" value="https%3A%2F%2Fwww.ubtob.com%2F">
-            <input type="hidden" name="spaceId" value="">
-            <input type="hidden" name="baseUrl" value="">
-            <div class="form-group">
-              <div class="x-has-feedback-left">
-                <input type="text" class="form-control x-input" autocomplete="on" placeholder="手机号/邮箱/账号ID" name="username" required="">
+        <div id="form-wrap" class="x-login-form">
+          <div>
+            <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>
                 <i class="fa fa-user"></i>
-              </div>
-            </div>
-            <div class="form-group" style="position: relative">
-              <div class="x-has-feedback-left">
-                <input type="password" class="form-control x-input" id="password" placeholder="密码" name="password" required="">
+              </el-form-item>
+              <el-form-item prop="password">
+                <el-input type="password" v-model="login.password" auto-complete="off" placeholder="密码"></el-input>
                 <i class="fa fa-lock"></i>
-              </div>
-              <i class="fa fa-keyboard-o" aria-hidden="true"></i>
-            </div>
-            <div class="form-group" id="captchaForm" style="display: none">
-              <input type="text" id="captcha" name="captcha" class="text" maxlength="10" required="">
-              <img id="captchaImage" src="sso/checkcode/login">
-              <a id="changeCode" href="javascript:void(0)">看不清换一张</a>
-            </div>
-            <div class="form-group">
-              <div class="x-has-feedback-left" style="display: inline-block"></div>
-              <div class="x-has-feedback-right">
-                <a href="user/pwd?appId=home&amp;returnURL=https%3A%2F%2Fwww.ubtob.com%2F">忘记密码?</a>
-              </div>
-            </div>
-            <button class="btn x-btn x-btn-primary btn-block x-btn-submit" type="button">登录</button>
-          </form>
+              </el-form-item>
+              <el-form-item prop="captcha" class="captcha" v-show="showCheckCode">
+                <el-input type="text" v-model="login.captcha" auto-complete="off" class="code-input"></el-input>
+                <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">
+                <a class="forget">忘记密码?</a>
+              </el-form-item>
+              <el-form-item>
+                <a class="btn login" @click="isLogin" :disabled="isLoginDisabled">登录</a>
+              </el-form-item>
+            </el-form>
+          </div>
           <div class="warn-text-area">
             为确保您账户的安全及正常使用,依《网络安全法》相关要求,6月1日起会员账户需绑定手机、设置密码保护。感谢您的理解和支持!
           </div>
           <div style="text-align: right;">
-            <a style="color: #5078cb;" href="sso/register_mall?appId=home&amp;returnURL=https%3A%2F%2Fwww.ubtob.com%2F">
+            <a href="sso/register_mall?appId=home&amp;returnURL=https%3A%2F%2Fwww.ubtob.com%2F">
               <i class="fa fa-arrow-circle-o-right"></i>免费注册</a>
           </div>
         </div>
@@ -66,7 +58,7 @@
             <span>打开手机客户端,扫描下面的二维码</span>
           </div>
           <div class="x-qrcode-img">
-            <img src="static/img/demo/qrcode.jpg?_v=1515216523548">
+            <img src="/images/all/qrcode.jpg">
           </div>
           <div class="x-qrcode-ex">
             <ul class="list-unstyled list-inline">
@@ -83,7 +75,145 @@
 
 <script>
   export default {
-    name: 'login'
+    name: 'login',
+    data () {
+      var validateUsername = (rule, value, callback) => {
+        if (value === '') {
+          this.checkUsername = false
+          this.showCheckCode = false
+        } else {
+          if (this.login.username !== '') {
+            //    获取密码输错次数
+            this.$http.get(`/sso/login/getPwdErrorCount`, {params: {username: this.login.username}})
+              .then(response => {
+                if (response.data) {
+                  this.showCheckCode = false
+                  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次今日将无法登陆')
+                    }
+                    this.isLoginDisabled = false
+                    this.checkUsername = true
+                    this.showCheckCode = true
+                  } else {
+                    this.checkUsername = false
+                    this.showCheckCode = false
+                  }
+                }
+              }, err => {
+                this.$message.error(err)
+                console.log(err)
+              })
+          }
+          callback()
+        }
+      }
+      var validatePassword = (rule, value, callback) => {
+        if (value === '') {
+          this.checkPassword = false
+        } else {
+          if (this.login.password !== '') {
+            this.checkPassword = true
+          }
+          callback()
+        }
+      }
+      return {
+        login: {
+          username: '',
+          password: '',
+          captcha: ''
+        },
+        checkUsername: false,
+        checkPassword: false,
+        showCheckCode: false,
+        isLoginDisabled: false,
+        rules2: {
+          username: [
+            {validator: validateUsername, trigger: 'blur'}
+          ],
+          password: [
+            {validator: validatePassword, trigger: 'blur'}
+          ]
+        }
+      }
+    },
+    methods: {
+//    获取验证码
+      getCode () {
+        var imgSrc = document.getElementById('captchaImage')
+        imgSrc.setAttribute('src', '/sso/login/checkCode?timestamp=' + (new Date()).valueOf())
+      },
+//      登录
+      isLogin () {
+        if (!this.checkUsername) {
+          this.$message.error('请填写账号')
+        } 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('spaceUU', '')
+          let config = {
+            headers: {'Content-Type': 'multipart/form-data'}
+          }
+          this.$http.post('/sso/login', param, config)
+            .then(response => {
+              if (response.data.success) {
+                console.log(response.data)
+              } else {
+                this.$message.error(response.data)
+                var count = response.data.errorCount
+                if (count < 3) {
+                  this.showCheckCode = false
+                  this.isLoginDisabled = false
+                } else if (count >= 5) {
+                  this.$message.error('密码错误次数已达上限,今日无法登陆')
+                  this.isLoginDisabled = true
+                  this.showCheckCode = false
+                } else if (count >= 3 && count < 5) {
+                  this.getCode()
+                  if (count === 3) {
+                    this.$message.error('当前已输错密码3次,若达到5次今日将无法登陆')
+                  }
+                  this.showCheckCode = true
+                  this.isLoginDisabled = false
+                }
+                return Promise.reject(response.data)
+              }
+            }).catch(err => {
+              console.log(err)
+              this.$message.error(err.errMsg)
+            })
+        }
+      }
+    }
   }
 </script>
 <style lang="scss" scoped>

+ 185 - 26
components/register/EnterpriseRegistration.vue

@@ -5,22 +5,35 @@
         <div class="content-top">
           <h3>企业注册</h3>
         </div>
-        <form action="" v-if="activeTab == 0">
-          <div class="form-group">
-            <input type="text" class="form-control" placeholder="手机号码"/>
-            <span class="tip">一个手机号可注册多个企业</span>
-          </div>
-          <div class="form-group">
-            <input type="text" class="form-control msg" placeholder="短信验证码"/>
-            <!--<span class="msg">获取验证码</span>-->
-            <span class="msg send">已发送(54s)</span>
-          </div>
-          <button class="btn">验证手机</button>
-          <div class="form-group agree">
-            <input type="checkbox"/>
-            <span class="agree">我已阅读并同意 <a href="">《优软云服务条款》</a></span>
-          </div>
-        </form>
+        <div v-if="activeTab == 0">
+          <el-form :model="enterprise" :rules="rules" ref="enterprise" label-width="100px" class="demo-ruleForm">
+            <el-form-item prop="mobile">
+              <el-input v-model="enterprise.mobile" placeholder="手机号码"></el-input>
+              <span class="tip" v-show="showMsgTip">单个手机号只能注册一个用户</span>
+              <span class="tip tip-mobile"
+                    v-show="mobileRegister">该手机号已被注册</span>
+            </el-form-item>
+            <el-form-item prop="code">
+              <el-input type="text" v-model="enterprise.code"
+                                    v-bind:class="{ active: this.codeErrorChecked }" auto-complete="off" class="msg" placeholder="短信验证码"></el-input>
+              <el-button type="primary" class="code"
+                         v-show="sendEnterpriseCode"
+                         @click="getCheckCode"
+                         :disabled="getCodeBtnIsDisabled">获取验证码</el-button>
+              <el-button type="primary"  v-show="!sendEnterpriseCode" class="code code-send">已发送({{enterprise_time}}s)</el-button>
+              <span v-show="codeErrorChecked" class="codeError-tip">验证码输入错误</span>
+            </el-form-item>
+            <el-form-item>
+              <a class="btn finish"
+                 @click="CheckPhone"
+                 :disabled="!this.checked || !this.mobileChecked || !this.codeChecked">验证手机</a>
+            </el-form-item>
+            <el-form-item>
+              <el-checkbox name="type" v-model="checked" @click="checkboxIsChecked"></el-checkbox>
+              <span class="agree">我已阅读并同意 <a href="">《优软云服务条款》</a></span>
+            </el-form-item>
+          </el-form>
+        </div>
         <form action="" v-if="activeTab == 1">
           <div class="form-group">
             <input type="text" class="form-control" placeholder="企业名称" />
@@ -71,8 +84,154 @@
   export default {
     name: 'EnterpriseRegistration',
     data () {
+      var validateMobile = (rule, value, callback) => {
+        if (value === '') {
+          callback(new Error('请填写正确的手机号'))
+          this.showMsgTip = false
+          this.getCodeBtnIsDisabled = true
+          this.mobileChecked = false
+          console.log(this.mobileChecked)
+        } else {
+          if (this.enterprise.mobile !== '') {
+            var reg = /^1[0-9]{10}$/
+            if (!reg.test(value)) {
+              callback(new Error('请填写正确的手机号'))
+              this.showMsgTip = false
+              this.getCodeBtnIsDisabled = true
+              this.mobileChecked = false
+            } else {
+              this.getCodeBtnIsDisabled = false
+              this.showMsgTip = false
+              this.mobileChecked = true
+            }
+          }
+          callback()
+        }
+      }
+      var validateCode = (rule, value, callback) => {
+        if (value === '') {
+          callback(new Error('请填写正确的验证码'))
+          this.codeErrorChecked = false
+          this.codeChecked = false
+        } else {
+          if (this.enterprise.code !== '') {
+            if (this.token !== '') {
+              if (this.enterprise.code !== '' && this.enterprise.mobile !== '') {
+                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/personal/register/checkCode`, param, config)
+                  .then(response => {
+                    if (response.data.success) {
+                      this.codeChecked = true
+                      this.codeErrorChecked = false
+                    } else {
+                      this.codeErrorChecked = true
+                      this.codeChecked = false
+                    }
+                  }, err => {
+//                  console.log(err)
+                    this.$message.error(err)
+                  })
+              }
+            } else {}
+          }
+          callback()
+        }
+      }
       return {
-        activeTab: 0
+        activeTab: 0,
+        enterprise: {
+          mobile: '',
+          code: ''
+        },
+        checked: true,
+        getCodeBtnIsDisabled: true,
+        mobileChecked: false,
+        codeChecked: false,
+        showMsgTip: true,
+        mobileRegister: false,
+        sendEnterpriseCode: true,
+        codeErrorChecked: false,
+        enterprise_time: 0,
+        rules: {
+          mobile: [
+            {validator: validateMobile, trigger: 'blur'}
+          ],
+          code: [
+            {validator: validateCode, trigger: 'blur'}
+          ]
+        }
+      }
+    },
+    methods: {
+//      我同意是否被选中
+      checkboxIsChecked () {
+        this.checked = !this.checked
+      },
+//      获取校验码
+      getCheckCode () {
+        this.$http.get(`/sso/userspace/register/checkCode`, {params: {mobile: this.enterprise.mobile}})
+          .then(response => {
+            this.token = response.data.token
+            if (this.token !== '') {
+              this.$message({
+                message: '验证码已经发送到您的手机,请注意查收',
+                type: 'success'
+              })
+              this.sendEnterpriseCode = false
+              this.enterprise_time = 60
+              var enterpriseTime = setInterval(() => {
+                this.enterprise_time--
+                if (this.enterprise_time <= 0) {
+                  this.sendEnterpriseCode = true
+                  clearInterval(enterpriseTime)
+                }
+              }, 1000)
+            }
+          }).catch(err => {
+            console.log(err)
+            this.$message.error(err.errMsg)
+          })
+      },
+//      验证手机
+      CheckPhone () {
+        if (this.mobileChecked && this.codeChecked) {
+          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']
+          console.log(appId)
+          let param = new FormData()
+          param.append('mobile', this.enterprise.mobile)
+          param.append('code', this.enterprise.code)
+          param.append('appId', appId)
+          param.append('token', this.token)
+          let config = {
+            headers: {'Content-Type': 'multipart/form-data'}
+          }
+          this.$http.post('/sso/userspace/register/checkAdminTel', param, config)
+            .then(response => {
+              if (response.data.success) {
+                console.log(response.data)
+              } else {
+                return Promise.reject(response.data)
+              }
+            }).catch(err => {
+              console.log(err)
+              this.$message.error(err.errMsg)
+            })
+        }
       }
     }
   }
@@ -107,12 +266,6 @@
           form {
             padding-bottom: 44px;
             margin-top: 35px;
-            .form-group{
-              margin: 0 auto 16px;
-              position: relative;
-              width: 360px;
-              height: 44px;
-              line-height: 44px;
               span.sure{
                 position: absolute;
                 top: 0;
@@ -120,6 +273,13 @@
                 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;
@@ -223,14 +383,13 @@
               }
               span.agree{
                 float: left;
-                margin-top: -15px;
+                margin: 0 0 0 10px;
                 font-size: 14px;
                 color: #8b8b8b;
                 a{
                   color: #0076ad;
                 }
               }
-              }
               .form-group.agree{
                 margin: 20px auto 0 !important;
               }
@@ -238,7 +397,7 @@
                 margin: 34px 0 16px 0;
                 width: 360px;
                 height: 44px;
-                line-height: 4px;
+                line-height: 44px;
                 font-size: 16px;
                 color: #fff;
                 background: #0076AD;

+ 305 - 93
components/register/PersonalRegistration.vue

@@ -5,44 +5,50 @@
         <div class="content-top">
           <h3>个人注册</h3>
         </div>
-        <form action="" @submit.prevent="validateBeforeSubmit">
-          <div class="form-group">
-            <input type="text" name="vipName"
-                  v-validate="'required|vipName'"
-                  :class="{'input': true, 'is-danger': errors.has('name') }"
-                  v-model="item.vipName" class="form-control" placeholder="会员名" />
-            <span v-show="errors.has('vipName')" class="help is-danger">{{errors.first('vipName')}}</span>
-          </div>
-          <div class="form-group">
-            <input type="password" name="password"
-                   v-model="item.password" class="form-control" placeholder="登录密码" />
-            <!--<i class="fa fa-keyboard-o" aria-hidden="true"></i>-->
-            <!--<div class="pwd sm">密码强度 <em></em><em></em><em></em><span>弱</span></div>-->
-            <!--<div class="pwd md">密码强度 <em></em><em></em><em></em><span>中</span></div>-->
-            <div class="pwd lar">密码强度 <em></em><em></em><em></em><span>强</span></div>
-          </div>
-          <div class="form-group">
-            <input type="password" class="form-control" placeholder="密码确认" v-model="item.confirm"/>
-            <!--<i class="fa fa-keyboard-o" aria-hidden="true"></i>-->
-          </div>
-          <div class="form-group">
-            <input type="text" class="form-control" placeholder="手机号码" v-model="item.mobile"/>
-            <span class="tip">单个手机号只能注册一个用户</span>
-          </div>
-          <div class="form-group">
-            <input type="text" class="form-control msg" placeholder="短信验证码" v-model="item.code"/>
-            <button class="msg" v-show="sendPersonalCode" @click="getCheckCode" :disabled="!item.mobile">获取验证码</button>
-            <span class="msg send" v-show="!sendPersonalCode" >已发送({{personal_time}}s)</span>
-          </div>
-          <button @click="registerNow(true, $event)" class="submitBtn" type="submit"
-                  :disabled="!item.vipName || !item.password || !item.confirm || !item.mobile || !item.code">完成注册</button>
-          <div class="form-group agree">
-            <input type="checkbox"/>
-            <span class="agree">我已阅读并同意 <a href="">《优软云服务条款》</a></span>
-          </div>
-        </form>
+        <div>
+          <el-form :model="item" :rules="rules2" ref="item" label-width="100px" class="demo-ruleForm">
+            <el-form-item prop="vipName">
+              <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>
+              <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="confirm">
+              <el-input type="password" v-model="item.confirm" auto-complete="off" placeholder="密码确认"></el-input>
+            </el-form-item>
+            <el-form-item prop="mobile">
+              <el-input v-model="item.mobile" placeholder="手机号码"></el-input>
+              <span class="tip" v-show="showMsgTip">单个手机号只能注册一个用户</span>
+              <span class="tip tip-mobile" v-show="mobileRegister">该手机号已被注册</span>
+            </el-form-item>
+            <el-form-item prop="code">
+              <el-input type="text" v-model="item.code"
+                        v-bind:class="{ active: this.codeErrorChecked }" auto-complete="off" class="msg" placeholder="短信验证码"></el-input>
+              <el-button type="primary" class="code"
+                         v-show="sendPersonalCode"
+                         @click="getCheckCode"
+                         :disabled="this.checkMobile">获取验证码</el-button>
+              <el-button type="primary"  v-show="!sendPersonalCode" class="code code-send">已发送({{personal_time}}s)</el-button>
+              <span v-show="codeErrorChecked" class="codeError-tip">验证码输入错误</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>
+            </el-form-item>
+
+            <el-form-item>
+              <el-checkbox name="type" v-model="checked" @click="checkboxChecked"></el-checkbox>
+              <span class="agree">我已阅读并同意 <a href="">《优软云服务条款》</a></span>
+            </el-form-item>
+          </el-form>
+        </div>
       </div>
-      <div class="login">已有账号?<a href="">立即登录</a></div>
+      <div class="login">已有账号?<a href="/">立即登录</a></div>
     </div>
   </div>
 </template>
@@ -51,64 +57,260 @@
   export default {
     name: 'PersonalRegistration',
     data () {
+      var validateName = (rule, value, callback) => {
+        if (!value) {
+          return callback(new Error('会员名不能为空'))
+        } else {
+          if (this.item.password !== '') {
+            if (value.length >= 2 && value.length <= 20) {
+              this.vipNameChecked = true
+            } else {
+              callback(new Error('请填写合适的会员名称,2~20个字符'))
+            }
+          }
+        }
+      }
+      var validatePass = (rule, value, callback) => {
+        if (value === '') {
+          callback(new Error('请输入密码'))
+        } else {
+          if (this.item.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
+              }
+            } else {
+              this.showMsgTip3 = false
+              this.showMsgTip2 = false
+              this.showMsgTip1 = false
+              this.showMsgTip4 = true
+            }
+          }
+          callback()
+        }
+      }
+      var validatePassTip = (rule, value, callback) => {
+        if (value === '') {
+          callback(new Error('请输入密码'))
+        } else {
+          if (this.item.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字符的英文、数字混合'))
+              }
+            } else {
+              callback(new Error('密码须为8-20字符的英文、数字混合'))
+            }
+          }
+          callback()
+        }
+      }
+      var validatePass2 = (rule, value, callback) => {
+        if (value === '') {
+          callback(new Error('请再次输入密码'))
+        } else if (value !== this.item.password) {
+          callback(new Error('两次输入密码不一致!'))
+        } else {
+          this.confirmChecked = true
+          callback()
+        }
+      }
+      var validateMobile = (rule, value, callback) => {
+        if (value === '') {
+          callback(new Error('请填写正确的手机号'))
+          this.showMsgTip = false
+        } else {
+          if (this.item.mobile !== '') {
+            var reg = /^1([0-9]{10})$/
+            if (!reg.test(value)) {
+              callback(new Error('请填写正确的手机号'))
+              this.showMsgTip = false
+              this.checkMobile = true
+              this.mobileRegister = false
+            } else {
+              this.$http.get(`/api/user/checkMobile`, {params: {mobile: this.item.mobile, mobileArea: ''}})
+                .then(response => {
+                  if (response.data.hasRegister) {
+                    this.mobileRegister = true
+                    this.showMsgTip = false
+                    this.checkMobile = true
+                  } else {
+                    this.showMsgTip = false
+                    this.checkMobile = false
+                    this.mobileRegister = false
+                    this.mobileChecked = true
+                  }
+                })
+            }
+          }
+          callback()
+        }
+      }
+      var validateCode = (rule, value, callback) => {
+        if (value === '') {
+          callback(new Error('请填写正确的验证码'))
+          this.codeErrorChecked = false
+        } else {
+          if (this.token !== '') {
+            if (this.item.code !== '' && this.item.mobile !== '') {
+              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
+                  } else {
+                    this.codeErrorChecked = true
+//                    callback(new Error('验证码输入错误'))
+                  }
+                }, err => {
+//                  console.log(err)
+                  this.$message.error(err)
+                })
+            }
+          } else {}
+          callback()
+        }
+      }
       return {
         item: {
           vipName: '',
-          msgName: '',
           password: '',
           confirm: '',
-          mobile: ''
+          mobile: '',
+          code: ''
         },
-        btnDisabled: false,
+        vipNameChecked: false,
+        passwordChecked: false,
+        confirmChecked: false,
+        mobileChecked: false,
+        codeChecked: false,
+        codeErrorChecked: false,
+        showMsgTip: true,
+        showMsgTip1: false,
+        showMsgTip2: false,
+        showMsgTip3: false,
+        showMsgTip4: false,
+        checkMobile: true,
+        checked: true,
+        token: '',
+        mobileRegister: false,
         sendPersonalCode: true,
-        personal_time: 0
+        personal_time: 0,
+        rules2: {
+          vipName: [
+            { validator: validateName, trigger: 'blur' }
+          ],
+          password: [
+            { validator: validatePassTip, trigger: 'blur' },
+            { validator: validatePass, trigger: 'change' }
+          ],
+          confirm: [
+            { required: true, validator: validatePass2, trigger: 'blur' }
+          ],
+          mobile: [
+            { validator: validateMobile, trigger: 'blur' }
+          ],
+          code: [
+            { validator: validateCode, trigger: 'blur' }
+          ]
+        }
       }
-    },
-    computed: {
-
     },
     methods: {
-      validateBeforeSubmit () {
-        this.$validator.validateAll().then((result) => {
-          if (result) {
-            console.log(result)
-            return
-          }
-          alert('Correct them errors!')
-        })
+//      我同意是否被选中
+      checkboxChecked () {
+        this.checked = !this.checked
       },
-      registerNow: function (isRegister, event) {
-        event.stopPropagation()
-        if (isRegister) {
-          this.$http.post('/sso/personal/register', [{
-            vipName: this.item.vipName,
-            password: this.item.password,
-            mobile: this.item.mobile,
-            mobileArea: this.item.mobileArea,
-            appId: this.item.appId,
-            code: this.item.code,
-            token: this.item.token
-          }])
+//      表单提交
+      submit () {
+        if (this.vipNameChecked && this.passwordChecked && this.confirmChecked && this.mobileChecked && this.codeChecked) {
+          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('vipName', this.item.vipName)
+          param.append('password', this.item.password)
+          param.append('mobile', this.item.mobile)
+//          param.append('mobileArea', '')
+          param.append('appId', 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 => {
+              if (response.data.success) {
+              } else {}
+            }, err => {
+              console.log(err)
+            })
         }
       },
 //      获取验证码
-      async getCode (params) {
-        let { data } = await this.$http.get(`/sso/personal/register/checkCode`, { params })
-        console.log(data)
-        this.$store.commit('register/checkPersonalCode/GET_PERSONAL_CODE_SUCCESS', data)
-      },
+//      async getCode () {
+//        let { data } = await this.$http.get(`/sso/personal/register/checkCode`, {params: {mobile: this.item.mobile}})
+//        this.token = data.token
+//      },
       getCheckCode () {
-        this.getCode()
-        this.$message.info('验证码已经发送到您的手机,请注意查收')
-        this.sendPersonalCode = false
-        this.personal_time = 60
-        var personalTime = setInterval(() => {
-          this.personal_time--
-          if (this.personal_time <= 0) {
-            this.sendPersonalCode = true
-            clearInterval(personalTime)
-          }
-        }, 1000)
+//        this.getCode()
+        this.$http.get(`/sso/personal/register/checkCode`, {params: {mobile: this.item.mobile}})
+          .then(response => {
+            this.token = response.data.token
+            if (this.token !== '') {
+              this.$message({
+                message: '验证码已经发送到您的手机,请注意查收',
+                type: 'success'
+              })
+              this.sendPersonalCode = false
+              this.personal_time = 60
+              var personalTime = setInterval(() => {
+                this.personal_time--
+                if (this.personal_time <= 0) {
+                  this.sendPersonalCode = true
+                  clearInterval(personalTime)
+                }
+              }, 1000)
+            } else {}
+          })
       }
     }
   }
@@ -143,12 +345,6 @@
         form {
           padding-bottom: 44px;
           margin-top: 35px;
-          .form-group{
-            margin: 0 auto 16px;
-            position: relative;
-            width: 360px;
-            height: 44px;
-            line-height: 44px;
             input{
               padding: 0 0 0 18px;
               width: 360px;
@@ -174,9 +370,8 @@
               cursor: pointer;
             }
             .pwd {
-              position: absolute;
-              top: 0;
-              right: -205px;
+              margin: 6px 0 -15px 0;
+              text-align: left;
               font-size: 13px;
               em{
                 display: inline-block;
@@ -225,13 +420,32 @@
                 color: #00a0e9;
               }
             }
+            .pwd.low{
+              color: #8c8c8c;
+              em{
+                background: #bfbfbf;
+              }
+            }
             span.tip{
               position: absolute;
-              top: 0;
+              top: 3px;
               right: -190px;
               font-size: 13px;
               color: #8c8c8c;
             }
+            span.tip.tip-mobile{
+              top: 3px;
+              right: -118px;
+              color: #ff4949;
+              font-size: 12px;
+            }
+            span.codeError-tip{
+              position: absolute;
+              top: 3px;
+              right: -105px;
+              color: #ff4949;
+              font-size: 12px;
+            }
             input.msg{
               float: left;
               width: 210px;
@@ -240,7 +454,6 @@
               float: right;
               width: 130px;
               height: 44px;
-              line-height: 44px;
               font-size: 14px;
               color: #5a5a5a;
               background: #f4f4f4;
@@ -269,14 +482,13 @@
             }
             span.agree{
               float: left;
-              margin-top: -15px;
+              margin: 2px 0 0 10px;
               font-size: 14px;
               color: #8b8b8b;
               a{
                 color: #0076ad;
               }
             }
-          }
           .form-group.agree{
             margin: 20px auto 0 !important;
           }

+ 1 - 1
nuxt.config.js

@@ -1,6 +1,6 @@
 const path = require('path')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
-const baseUrl = process.env.BASE_URL || (isProdMode ? 'https://city-service.ubtob.com' : 'http://192.168.253.66:8000/')
+const baseUrl = process.env.BASE_URL || (isProdMode ? 'https://city-service.ubtob.com' : 'http://192.168.253.118:8000/')
 
 module.exports = {
   router: {

+ 1 - 1
package.json

@@ -10,7 +10,7 @@
     "bootstrap": "^3.3.7",
     "cookiejar": "^2.1.1",
     "cross-env": "^3.1.4",
-    "element-ui": "^1.3.7",
+    "element-ui": "^2.0.11",
     "express": "^4.14.1",
     "font-awesome": "^4.7.0",
     "http-proxy-middleware": "^0.17.4",

+ 14 - 10
plugins/element-ui.js

@@ -1,12 +1,16 @@
+// import Vue from 'vue'
+// import { Message, Breadcrumb, BreadcrumbItem, Tree, Pagination, Upload, Dialog, Form } from 'element-ui'
+//
+// Vue.use(Breadcrumb)
+// Vue.use(BreadcrumbItem)
+// Vue.use(Tree)
+// Vue.use(Pagination)
+// Vue.use(Upload)
+// Vue.use(Dialog)
+// Vue.use(Form)
+//
+// Vue.prototype.$message = Message
 import Vue from 'vue'
-import { Message, Breadcrumb, BreadcrumbItem, Tree, Pagination, Upload, Dialog, Form } from 'element-ui'
+import ElementUI from 'element-ui'
 
-Vue.use(Breadcrumb)
-Vue.use(BreadcrumbItem)
-Vue.use(Tree)
-Vue.use(Pagination)
-Vue.use(Upload)
-Vue.use(Dialog)
-Vue.use(Form)
-
-Vue.prototype.$message = Message
+Vue.use(ElementUI)

+ 46 - 49
plugins/vee-validate.js

@@ -1,59 +1,56 @@
-import Vue from 'vue'
-import VeeValidate, {Validator} from 'vee-validate'
-import zh from 'vee-validate/dist/locale/zh_CN'
-import VueI18n from 'vue-i18n'
-
-Vue.use(VueI18n)
-
-const i18n = new VueI18n({
-  locale: 'zh_CN'
-})
-
-Vue.use(VeeValidate, {
-  i18n,
-  i18nRootKey: 'validation',
-  dictionary: {
-    zh
-  }
-})
+// import Vue from 'vue'
+// import VeeValidate, {Validator} from 'vee-validate'
+// import zh from 'vee-validate/dist/locale/zh_CN'
+// import VueI18n from 'vue-i18n'
+//
+// Vue.use(VueI18n)
+
+// const i18n = new VueI18n({
+//   locale: 'zh_CN'
+// })
+
+// Vue.use(VeeValidate, {
+//   i18n,
+//   i18nRootKey: 'validation',
+//   dictionary: {
+//     zh
+//   }
+// })
 
 // 配置中文
 // Validator.addLocale(zh)
 
-const config = {
-  locale: 'zh_CN'
-}
+// const config = {
+//   locale: 'zh_CN'
+// }
 
-Vue.use(VeeValidate, config)
+// Vue.use(VeeValidate, config)
 
 // 自定义validate
-const dictionary = {
-  zh_CN: {
-    messages: {
-      vipName: () => '用户名不能为空',
-      required: (field) => '请输入' + field
-    },
-    attributes: {
-      vipName: '会员名'
-    }
-  }
-}
-console.log('1', dictionary)
-console.log(Validator)
-
-Validator.localize('zh_CN', dictionary)
+// const dictionary = {
+//   zh_CN: {
+//     messages: {
+//       vipName: () => '用户名不能为空',
+//       required: (field) => '请输入' + field
+//     },
+//     attributes: {
+//       vipName: '会员名'
+//     }
+//   }
+// }
+// Validator.localize('zh_CN', dictionary)
 
 // 自定义会员名验证
-Validator.extend('vipName', {
-  getMessage: field => field + '会员名不能为空',
-  validate: value => {
-    return value.length === ''
-  }
-})
+// Validator.extend('vipName', {
+//   getMessage: field => field + '会员名不能为空',
+//   validate: value => {
+//     return value.length === ''
+//   }
+// })
 // 自定义手机验证
-Validator.extend('phone', {
-  getMessage: field => field + '必须是11位手机号码',
-  validate: value => {
-    return value.length === 11 && /^((13|14|15|17|18)[0-9]{1}\d{8})$/.test(value)
-  }
-})
+// Validator.extend('phone', {
+//   getMessage: field => field + '必须是11位手机号码',
+//   validate: value => {
+//     return value.length === 11 && /^((13|14|15|17|18)[0-9]{1}\d{8})$/.test(value)
+//   }
+// })

BIN
static/images/all/login.jpg


BIN
static/images/all/qrcode.jpg


+ 21 - 21
store/register.js

@@ -1,25 +1,25 @@
-import axios from '~plugins/axios'
+// import axios from '~plugins/axios'
 
-export const actions = {
+// export const actions = {
   // 个人注册
-  PersonalRegister ({ commit }, params = {}) {
-    commit('personalRegister/REQUEST_PERSONAL', params)
-    return axios.post(`/sso/personal/register`, {params})
-      .then(response => {
-        commit('personalRegister/GET_PERSONAL_SUCCESS', response.data)
-      }, err => {
-        commit('personalRegister/GET_PERSONAL_FAILURE', err)
-      })
-  },
+  // PersonalRegister ({ commit }, params = {}) {
+  //   commit('personalRegister/REQUEST_PERSONAL', params)
+  //   return axios.post(`/sso/personal/register`, {params})
+  //     .then(response => {
+  //       commit('personalRegister/GET_PERSONAL_SUCCESS', response.data)
+  //     }, err => {
+  //       commit('personalRegister/GET_PERSONAL_FAILURE', err)
+  //     })
+  // },
   // 获取校验码
-  getCheckCode ({ commit }, params = {}) {
-    commit('checkCode/REQUEST_CHECK_CODE', params)
-    return axios.get(`/sso/personal/register/checkCode`, {params})
-      .then(response => {
-        commit('checkCode/GET_CHECK_CODE_SUCCESS', response.data)
-      }, err => {
-        commit('checkCode/GET_CHECK_CODE_FAILURE', err)
-      })
-  }
-}
+  // getCheckCode ({ commit }, params = {}) {
+  //   commit('checkCode/REQUEST_CHECK_CODE', params)
+  //   return axios.get(`/sso/personal/register/checkCode`, {params})
+  //     .then(response => {
+  //       commit('checkCode/GET_CHECK_CODE_SUCCESS', response.data)
+  //     }, err => {
+  //       commit('checkCode/GET_CHECK_CODE_FAILURE', err)
+  //     })
+  // }
+// }
 

+ 19 - 19
store/register/checkPersonalCode.js

@@ -1,19 +1,19 @@
-export const state = () => ({
-  checkPersonalCode: {
-    fetching: false,
-    data: []
-  }
-})
-
-export const mutations = {
-  REQUEST_PERSONAL_CODE (state) {
-    state.checkPersonalCode.fetching = true
-  },
-  GET_PERSONAL_CODE_FAILURE (state) {
-    state.checkPersonalCode.fetching = false
-  },
-  GET_PERSONAL_CODE_SUCCESS (state, result) {
-    state.checkPersonalCode.fetching = false
-    state.checkPersonalCode.data = result
-  }
-}
+// export const state = () => ({
+//   checkPersonalCode: {
+//     fetching: false,
+//     data: []
+//   }
+// })
+//
+// export const mutations = {
+//   REQUEST_PERSONAL_CODE (state) {
+//     state.checkPersonalCode.fetching = true
+//   },
+//   GET_PERSONAL_CODE_FAILURE (state) {
+//     state.checkPersonalCode.fetching = false
+//   },
+//   GET_PERSONAL_CODE_SUCCESS (state, result) {
+//     state.checkPersonalCode.fetching = false
+//     state.checkPersonalCode.data = result
+//   }
+// }

+ 19 - 19
store/register/personalRegister.js

@@ -1,19 +1,19 @@
-export const state = () => ({
-  code: {
-    fetching: false,
-    data: []
-  }
-})
-
-export const mutations = {
-  REQUEST_CHECK_CODE (state) {
-    state.code.fetching = true
-  },
-  GET_CHECK_CODE_FAILURE (state) {
-    state.code.fetching = false
-  },
-  GET_CHECK_CODE_SUCCESS (state, result) {
-    state.code.fetching = false
-    state.code.data = result
-  }
-}
+// export const state = () => ({
+//   code: {
+//     fetching: false,
+//     data: []
+//   }
+// })
+//
+// export const mutations = {
+//   REQUEST_CHECK_CODE (state) {
+//     state.code.fetching = true
+//   },
+//   GET_CHECK_CODE_FAILURE (state) {
+//     state.code.fetching = false
+//   },
+//   GET_CHECK_CODE_SUCCESS (state, result) {
+//     state.code.fetching = false
+//     state.code.data = result
+//   }
+// }