Explorar o código

1、增加正在设置邮箱等待加载的页面;2、更改未验证手机的提示文字;3、增加验证手机和邮箱是否已存在接口;4、手机端、PC端登录页面点击去注册时链接上带的参数在点击个人注册和企业注册两者切换时使一直被保存;5、更换管理员增加链接问号后的键值对

hangb %!s(int64=7) %!d(string=hai) anos
pai
achega
f5263bbc2f

+ 0 - 1
components/change/ChangeManagerSecondStep.vue

@@ -263,7 +263,6 @@
         if (this.newAdminNameChecked && this.mobileSecondChecked && this.secondCodeChecked && this.changeReasonChecked && this.contactTelChecked) {
           this.isShowLoading = true
           let param = new FormData()
-          console.log(this.firstStepToken.token)
           param.append('newAdminName', this.valid2.newAdminName)
           param.append('mobile', this.valid2.mobile)
           param.append('code', this.valid2.code)

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

@@ -83,7 +83,7 @@
                    @click="goVaildPhoneStep"
                    size="tiny">
           <div class="set-tip" v-show="goValidPhone">
-            <p>您的账号未验证手机,请先验证手机号</p>
+            <p>您的账号未验证手机,请先验证手机号</p>
             <a href="/validation/phoneValidation">确定</a>
           </div>
         </el-dialog>

+ 11 - 5
components/login/Login.vue

@@ -73,7 +73,7 @@
               为确保您账户的安全及正常使用,依《网络安全法》相关要求,6月1日起会员账户需绑定手机、设置密码保护。感谢您的理解和支持!
             </div>
             <div class="link-go">
-              <a href="appeals/changeManagerAppeal" class="first">更换管理员</a>
+              <a @click="changeManage" class="first">更换管理员</a>
               <a id="register" @click="goRegister" class="second">
                 <i class="fa fa-arrow-circle-o-right"></i>免费注册</a>
             </div>
@@ -192,6 +192,7 @@
         showCheckCode: false,
         isLoginDisabled: false,
         dialogVisible: false,
+        queryLink: '',
         rules2: {
           username: [
             {validator: validateUsername, trigger: 'blur'}
@@ -221,6 +222,10 @@
       // }
     },
     methods: {
+      // 更换管理员
+      changeManage () {
+        window.location.href = `appeals/changeManagerAppeal${this.$store.state.option.fullPath}`
+      },
 //      获取url参数
       getUrl () {
         var url = window.location.search
@@ -228,6 +233,7 @@
         if (url.indexOf('?' !== -1)) {
           var str = url.substr(1)
           var strs = str.split('&')
+          this.queryLink = str
           for (var i = 0; i < strs.length; i++) {
             request[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1])
           }
@@ -271,15 +277,15 @@
       },
 //      忘记密码
       goForgetPassword () {
-        let url = `/reset/forgetPasswordValidationAccount?appId=${this.appId}&returnUrl=${this.returnUrl}`
+        let url = `/reset/forgetPasswordValidationAccount?${this.queryLink}`
         document.getElementById('forget').href = url
       },
 //      去注册
       goRegister () {
         if (this.appId === 'mall') {
-          var registerurl = `/register/personalRegistration?appId=${this.appId}&returnUrl=${this.returnUrl}`
+          var registerurl = `/register/personalRegistration?${this.queryLink}`
         } else {
-          registerurl = `/register/enterpriseRegistration?appId=${this.appId}&returnUrl=${this.returnUrl}`
+          registerurl = `/register/enterpriseRegistration?${this.queryLink}`
         }
         document.getElementById('register').href = registerurl
       },
@@ -302,10 +308,10 @@
           param.append('username', this.login.username)
           param.append('password', this.login.password)
           param.append('captcha', this.login.captcha)
+          param.append('spaceUU', this.login.spaceUU)
           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'}
           }

+ 7 - 3
components/mobile/loginMobile.vue

@@ -6,7 +6,7 @@
   <div class="page-part">
     <mt-field placeholder="密码" v-model="login.password" type="password"></mt-field>
     <template>
-      <p class="passwd"><a href="/reset/forgetPasswordValidationAccount" class="rgba">忘记密码?</a></p>
+      <p class="passwd"><a @click="forgetPwd" class="rgba">忘记密码?</a></p>
     </template>
   </div>
   <template v-if="showCheckCode">
@@ -68,11 +68,15 @@
         this.popupVisible = flag
         this.toLogin(flag)
       },
+      // 忘记密码
+      forgetPwd () {
+        window.location.href = `/reset/forgetPasswordValidationAccount${this.$store.state.option.fullPath}`
+      },
       jump () {
         if (this.appId === 'mall') {
-          window.location.href = `/register/personalRegistration?appId=${this.appId}&returnUrl=${this.returnUrl}`
+          window.location.href = `/register/personalRegistration${this.$store.state.option.fullPath}`
         } else {
-          window.location.href = `/register/enterpriseRegistration?appId=${this.appId}&returnUrl=${this.returnUrl}`
+          window.location.href = `/register/enterpriseRegistration${this.$store.state.option.fullPath}`
         }
       },
       getUrl () {

+ 5 - 1
components/mobile/registerEnterprise/index.vue

@@ -2,7 +2,7 @@
   <div class="f-main">
     <div class="content-top">
       <p>企业注册</p>
-      <a class="go" href="/register/personalRegistration"><i class="fa fa-long-arrow-right"></i>个人注册</a>
+      <a class="go" @click="goRegister"><i class="fa fa-long-arrow-right"></i>个人注册</a>
     </div>
     <template v-if="step === 1">
       <div class="f-form">
@@ -139,6 +139,10 @@
       }
     },
     methods: {
+      // 注册
+      goRegister () {
+        window.location.href = `/register/personalRegistration${this.$store.state.option.fullPath}`
+      },
       // 弹窗处理
       downToast (type) {
         this.$toast({

+ 5 - 1
components/mobile/registerPersonal/index.vue

@@ -2,7 +2,7 @@
   <div class="f-main">
     <div class="content-top">
       <p>个人注册</p>
-      <a class="go" href="/register/enterpriseRegistration"><i class="fa fa-long-arrow-right"></i>企业注册</a>
+      <a class="go" @click="goRegister"><i class="fa fa-long-arrow-right"></i>企业注册</a>
     </div>
     <div class="f-form">
       <div class="page-part">
@@ -83,6 +83,10 @@
       }
     },
     methods: {
+      // 注册
+      goRegister () {
+        window.location.href = `/register/enterpriseRegistration${this.$store.state.option.fullPath}`
+      },
       // 验证弹窗
       downToast (type) {
         this.$toast({

+ 29 - 13
components/register/EnterpriseRegistration.vue

@@ -4,7 +4,7 @@
       <div class="content">
         <div class="content-top">
           <h3>企业注册</h3>
-          <a class="go" href="/register/personalRegistration"><i class="fa fa-long-arrow-right"></i>个人注册</a>
+          <a class="go" @click="goRegister"><i class="fa fa-long-arrow-right"></i>个人注册</a>
         </div>
         <div v-show="goNextStep">
           <el-form :model="enterprise" :rules="rules" ref="enterprise" label-width="100px" class="demo-ruleForm">
@@ -399,7 +399,6 @@
                 this.$http.get(`/api/user/checkEmail`, {params: {email: this.enterprise1.email}})
                   .then(response => {
                     if (response.data.hasRegister) {
-                      console.log(response.data.hasRegister)
                       this.emailChecked = false
                       this.emailHasRegister = true
                     } else {
@@ -462,6 +461,8 @@
         isSpaceNameExist: false,
         isBusinessCodeExist: false,
         emailHasRegister: false,
+        queryLink: '',
+        appId: '',
 //        企业注册第一步
         rules: {
           mobile: [
@@ -495,7 +496,32 @@
         }
       }
     },
+    mounted () {
+//      获取链接
+      this.$nextTick(() => {
+        this.getUrl()
+      })
+    },
     methods: {
+      // 获取链接
+      getUrl () {
+        var url = window.location.search
+        var request = {}
+        if (url.indexOf('?' !== -1)) {
+          var str = url.substr(1)
+          var strs = str.split('&')
+          this.queryLink = str
+          for (var i = 0; i < strs.length; i++) {
+            request[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1])
+          }
+        }
+        this.appId = request['appId'] || ''
+      },
+      // 注册
+      goRegister () {
+        console.log(this.queryLink)
+        window.location.href = `/register/personalRegistration?${this.queryLink}`
+      },
 //      我同意是否被选中
       checkboxIsChecked () {
         this.checked = !this.checked
@@ -535,20 +561,10 @@
       checkPhone () {
         if (this.mobileChecked && this.codeChecked && this.checked) {
           this.isShowLoading = true
-          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('mobile', this.enterprise.mobile)
           param.append('code', this.enterprise.code)
-          param.append('appId', appId)
+          param.append('appId', this.appId)
           param.append('token', this.token)
           let config = {
             headers: {'Content-Type': 'multipart/form-data'}

+ 28 - 12
components/register/PersonalRegistration.vue

@@ -4,7 +4,7 @@
       <div class="content">
         <div class="content-top">
           <h3>个人注册</h3>
-          <a class="go" href="/register/enterpriseRegistration"><i class="fa fa-long-arrow-right"></i>企业注册</a>
+          <a class="go"  @click="goRegister"><i class="fa fa-long-arrow-right"></i>企业注册</a>
         </div>
         <div>
           <el-form :model="item" :rules="rules2" ref="item" label-width="100px" class="demo-ruleForm">
@@ -280,6 +280,8 @@
         sendPersonalCode: true,
         codeErrorMsg: '',
         personal_time: 0,
+        queryLink: '',
+        appId: '',
         rules2: {
           vipName: [
             { validator: validateName, trigger: 'blur' }
@@ -300,7 +302,31 @@
         }
       }
     },
+    mounted () {
+//      获取链接
+      this.$nextTick(() => {
+        this.getUrl()
+      })
+    },
     methods: {
+      // 获取链接
+      getUrl () {
+        var url = window.location.search
+        var request = {}
+        if (url.indexOf('?' !== -1)) {
+          var str = url.substr(1)
+          var strs = str.split('&')
+          this.queryLink = str
+          for (var i = 0; i < strs.length; i++) {
+            request[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1])
+          }
+        }
+        this.appId = request['appId'] || ''
+      },
+      // 注册
+      goRegister () {
+        window.location.href = `/register/enterpriseRegistration?${this.queryLink}`
+      },
 //      我同意是否被选中
       checkboxChecked () {
         this.checked = !this.checked
@@ -309,22 +335,12 @@
       submit () {
         if (this.vipNameChecked && this.passwordChecked && this.confirmChecked && this.mobileChecked && this.codeChecked && this.checked) {
           this.isShowLoading = true
-          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('appId', this.appId)
           param.append('code', this.item.code)
           param.append('token', this.token)
           let config = {

+ 1 - 1
components/reset/PasswordResetValidQuestion.vue

@@ -134,7 +134,7 @@
               if (response.data.content.questions.length === 0) {
                 this.$router.push({ path: '/reset/passwordResetNewPassword' })
               }
-              console.log(response.data.content.questions)
+              // console.log(response.data.content.questions)
               this.getQuestions = response.data.content.questions
               this.question1 = this.getQuestions[0].question
               this.question2 = this.getQuestions[1].question

+ 1 - 1
components/validation/EmailValidation.vue

@@ -128,7 +128,7 @@
                    @close="goVaildPhoneStep"
                    size="tiny">
           <div class="set-tip" v-show="goValidPhone">
-            <p>您的账号未验证手机,请先验证手机号</p>
+            <p>您的账号未验证手机,请先验证手机号</p>
             <a href="/validation/phoneValidation">确定</a>
           </div>
         </el-dialog>

+ 24 - 3
components/validation/EmailValidationSecondStep.vue

@@ -13,7 +13,10 @@
           <div>
             <el-form :model="valid2" :rules="rules2" ref="valid2" label-width="100px" class="demo-ruleForm">
               <el-form-item prop="email">
-                <el-input v-model="valid2.email" placeholder="新邮箱地址"></el-input>
+                <el-input v-model="valid2.email"
+                          v-bind:class="{ active: emailSecondExit }"
+                          placeholder="新邮箱地址"></el-input>
+                <span class="tip tip-mobile" v-show="emailSecondExit">该邮箱已被注册</span>
               </el-form-item>
               <el-form-item>
                 <a class="btn finish"
@@ -41,19 +44,30 @@
       Loading
     },
     data () {
-//      第二步验证手机
+//      第二步验证邮箱
       var validateSecondEmail = (rule, value, callback) => {
         if (value === '') {
           callback(new Error('请填写正确的邮箱号'))
           this.emailSecondChecked = false
+          this.emailSecondExit = false
         } else {
           if (this.valid2.email !== '') {
             var reg = /^([\w-])+(\.\w+)*@([\w-])+((\.\w{2,3}){1,3})$/
             if (!reg.test(value)) {
               callback(new Error('请填写正确的邮箱号'))
               this.emailSecondChecked = false
+              this.emailSecondExit = false
             } else {
-              this.emailSecondChecked = true
+              this.$http.get(`/update/user/email/hasRegister`, {params: {email: this.valid2.email}})
+                .then(response => {
+                  if (response.data.content.hasRegister) {
+                    this.emailSecondChecked = false
+                    this.emailSecondExit = true
+                  } else {
+                    this.emailSecondChecked = true
+                    this.emailSecondExit = false
+                  }
+                })
             }
           }
           callback()
@@ -63,6 +77,7 @@
         isShowLoading: false,
         sendEmailSuccess: false,
         emailSecondChecked: false,
+        emailSecondExit: false,
         valid2: {
           email: ''
         },
@@ -226,6 +241,12 @@
                   color: #0076ad;
                 }
               }
+              span.tip.tip-mobile{
+                top: 3px;
+                right: -105px;
+                color: #ff4949;
+                font-size: 12px;
+              }
               span.tip.codeError-tip{
                 position: absolute;
                 top: 3px;

+ 26 - 4
components/validation/PhoneValidationSecondStep.vue

@@ -13,11 +13,14 @@
           <div>
             <el-form :model="valid2" :rules="rules2" ref="valid2" label-width="100px" class="demo-ruleForm">
               <el-form-item prop="mobile">
-                <el-input v-model="valid2.mobile" placeholder="新手机号码"></el-input>
+                <el-input v-model="valid2.mobile"
+                          v-bind:class="{active: mobileSecondExit}"
+                          placeholder="新手机号码"></el-input>
+                <span class="tip tip-mobile" v-show="mobileSecondExit">该手机已被注册</span>
               </el-form-item>
               <el-form-item prop="code">
                 <el-input type="text" v-model="valid2.code"
-                          v-bind:class="{ active: this.secondStepCodeErrorChecked }"
+                          v-bind:class="{ active: secondStepCodeErrorChecked }"
                           auto-complete="off"
                           class="msg"
                           placeholder="短信验证码"></el-input>
@@ -57,6 +60,7 @@
           callback(new Error('请填写正确的手机号'))
           this.getCodeBtnIsDisabled = true
           this.mobileSecondChecked = false
+          this.mobileSecondExit = false
         } else {
           if (this.valid2.mobile !== '') {
             var reg = /^1[0-9]{10}$/
@@ -64,9 +68,20 @@
               callback(new Error('请填写正确的手机号'))
               this.getCodeBtnIsDisabled = true
               this.mobileSecondChecked = false
+              this.mobileSecondExit = false
             } else {
-              this.getCodeBtnIsDisabled = false
-              this.mobileSecondChecked = true
+              this.$http.get(`/update/user/mobile/hasRegister`, {params: {mobile: this.valid2.mobile}})
+                .then(response => {
+                  if (response.data.content.hasRegister) {
+                    this.getCodeBtnIsDisabled = true
+                    this.mobileSecondChecked = false
+                    this.mobileSecondExit = true
+                  } else {
+                    this.getCodeBtnIsDisabled = false
+                    this.mobileSecondChecked = true
+                    this.mobileSecondExit = false
+                  }
+                })
             }
           }
           callback()
@@ -123,6 +138,7 @@
         mobileSecondChecked: false,
         getCodeBtnIsDisabled: true,
         showSecondStepCode: true,
+        mobileSecondExit: false,
         valid2: {
           mobile: '',
           code: ''
@@ -330,6 +346,12 @@
                   color: #0076ad;
                 }
               }
+              span.tip.tip-mobile{
+                top: 3px;
+                right: -105px;
+                color: #ff4949;
+                font-size: 12px;
+              }
               span.tip.codeError-tip{
                 position: absolute;
                 top: 3px;

+ 0 - 1
middleware/authenticated.js

@@ -4,7 +4,6 @@ export default function ({ isServer, store, req, redirect }) {
 
   // if (!store.state.option.isLogin.logged) {
   if (!store.state.option.isLogin.data.content.isLogin) {
-    console.log(store.state.option.isLogin.data.content.isLogin + '111')
     return redirect('/')
   }
 }

+ 11 - 3
pages/cloudcenter/enterprise/index.vue

@@ -6,8 +6,8 @@
         <div class="container">
           <div class="table-list">
             <div class="table-top">
-              <h3>成员列表</h3>
-              <a class="btn-us-apply" @click="toggle = !toggle">申请列表</a>
+              <h3>成员列表{{user.userspace.admin.userUU === user.user.userUU}}{{isToggleDialogVisible}}</h3>
+              <a class="btn-us-apply" @click="user.userspace.admin.userUU === user.user.userUU ? toggle = !toggle : isToggleDialogVisible = true">申请列表</a>
             </div>
             <table class="table table-striped" v-if="member.content.length !== 0">
               <thead>
@@ -96,6 +96,14 @@
       </span>
       </el-dialog>
     </template>
+    <template>
+      <el-dialog class="center"
+                 title="温馨提示"
+                 :visible.sync="isToggleDialogVisible"
+                 width="30%">
+        <span style="font-size: 14px;">您不是管理员,无审批申请权限。</span>
+      </el-dialog>
+    </template>
   </div>
 </template>
 
@@ -117,6 +125,7 @@
     data () {
       return {
         centerDialogVisible: true,
+        isToggleDialogVisible: false,
         toggle: true,
         page: 1,
         count: 20
@@ -133,7 +142,6 @@
         return this.$store.state.cloudCenter.apple.data.content
       },
       member () {
-        console.log(this.$store.state.cloudCenter.member.data.content)
         return this.$store.state.cloudCenter.member.data.content
       }
     },

+ 31 - 0
pages/validation/index.vue

@@ -0,0 +1,31 @@
+<template>
+  <div class="loading">
+    <loading/>
+    <p>正在设置邮箱,请稍后......</p>
+  </div>
+</template>
+
+<script>
+  import Loading from '~components/common/loading/Loading.vue'
+  export default {
+    name: 'logout',
+    layout: 'mobile',
+    components: {
+      Loading
+    }
+  }
+</script>
+<style type="text/scss" lang="scss" scoped>
+  .loading{
+    p{
+      position: fixed;
+      left: 0;
+      right:0;
+      top: 54%;
+      z-index: 1000;
+      text-align: center;
+      font-size: 16px;
+      color:#333;
+    }
+  }
+</style>

+ 4 - 0
store/index.js

@@ -12,6 +12,10 @@ export const actions = {
     store.commit('option/SET_USER_AGENT', userAgent)
     store.commit('option/SET_COOKIES', cookie)
     // 保存appId和returnUrl信息
+    // 保存链接?之后的所有键值对以字符串形式
+    let fullPath = route.fullPath.slice(route.fullPath.lastIndexOf('?')) || ''
+    store.commit('option/SET_FULLPATH', fullPath)
+    // console.log('111', route.fullPath.slice(route.fullPath.lastIndexOf('?')))
     if (route.query) {
       let appId = route.query.appId || ''
       let returnUrl = route.query.returnURL || ''

+ 4 - 0
store/option.js

@@ -17,6 +17,7 @@ export const state = {
   baseUrl: '',
   inviteSpaceUU: '',
   inviteUserUU: '',
+  fullPath: '',
   // 用户信息
   isLogin: {
     // 是否登录
@@ -70,6 +71,9 @@ export const mutations = {
   SET_INVITATIONTIME (state, result) {
     state.invitationTime = result || ''
   },
+  SET_FULLPATH (state, result) {
+    state.fullPath = result || ''
+  },
   REQUEST_USER_INFO (state) {
     state.userInfo.fetching = true
   },