Browse Source

新增验证码倒计时

lisiyan 2 years ago
parent
commit
94a96fcbbe

+ 1 - 1
src/App.vue

@@ -16,7 +16,7 @@ export default {
 
 <template>
   <div id="app">
-    <el-container v-if="$route.fullPath.indexOf('/login') === -1 && $route.fullPath.indexOf('/Create') === -1 && $route.fullPath.indexOf('/forgotpassword') === -1">
+    <el-container v-if="$route.fullPath.indexOf('/login') === -1 && $route.fullPath.indexOf('/Create') === -1 && $route.fullPath.indexOf('/forgotpassword') === -1 && $route.fullPath.indexOf('/noadmin') === -1">
       <el-aside width="260px" class="relative"><SideMenu ref="sideMenu" /></el-aside>
       <el-main><router-view :getInfo="getInfo" /></el-main>
     </el-container>

+ 1 - 2
src/router/index.js

@@ -121,7 +121,7 @@ const router = new VueRouter({
 })
 router.beforeEach((to, from, next) => {
   const whiteList = '/login'
-  if (to.path !== whiteList && to.path !== '/creat' && to.path !== '/noadmin') {
+  if (to.path !== whiteList && to.path !== '/Create' && to.path !== '/noadmin') {
     if (parseInt(userStore().user.role) === 1 || parseInt(userStore().user.role) === 2) {
       next()
     } else {
@@ -130,7 +130,6 @@ router.beforeEach((to, from, next) => {
   } else {
     next()
   }
-  next()
 })
 
 export default router

+ 11 - 0
src/views/Assignlicense.vue

@@ -408,9 +408,20 @@ export default {
 .el-select-dropdown::v-deep .popper__arrow {
   display: none;
 }
+.el-select ::v-deep .el-tag {
+  color: #505258 !important;
+  border: 1px solid #8D9CB9 !important;
+  background-color: #EEF4FF !important;
+}
 </style>
 
 <style lang="scss">
+.el-tag__close {
+  font-weight: 700;
+  font-size: 18px !important;
+  color: #8D9CB9 !important;
+  background-color: #EEF4FF !important;
+}
 .popper__arrow {
   display: none !important;
 }

+ 43 - 15
src/views/Create.vue

@@ -15,12 +15,14 @@ export default {
       checkBox: false,
       passwordType: false,
       passwordConfirmType: false,
-      result: true,
       teamIds: '',
       EmailCodeError: false,
       verificationCodeError: false,
       passwordError: false,
       passwordConfirmError: false,
+      CountDown: 60, //倒计时
+      buttonName: 'send', //按钮初始化文字
+      isDisabled: false, //是否禁用按钮
       ruleForm: {
         email: '',
         verificationCode: '',
@@ -136,17 +138,14 @@ export default {
                 })
               } else if (
                 res.data.code === 700 &&
-                res.data.msg === "Email has been created"
+                res.data.msg === 'Email has been created'
               ) {
                 this.EmailCodeError = true
                 this.$message.error({
                   duration: 5000,
                   message: 'Email has been created'
                 })
-              } else if (
-                res.data.code === 200 &&
-                res.data.msg === '注册成功'
-              ) {
+              } else if (res.data.code === 200 && res.data.msg === '注册成功') {
                 this.$message({
                   duration: 5000,
                   message: 'Create Success',
@@ -167,8 +166,18 @@ export default {
       }
     },
     sendEmail() {
-      if (this.result) {
-        console.log(this.ruleForm.email)
+      let timerId = setInterval(() => {
+        this.CountDown--
+        this.isDisabled = true
+        this.buttonName = 'Retry in ' + this.CountDown + ' seconds'
+        if (this.CountDown <= 0) {
+          clearInterval(timerId)
+          this.buttonName = 'resend'
+          this.CountDown = 60
+          this.isDisabled = false
+        }
+      }, 1000)
+      if (!this.isDisabled) {
         //发送邮件
         get(
           '/pdf-tech/auth/getVerifyCode?action=0&type=0&receiver=' +
@@ -178,7 +187,7 @@ export default {
         })
       }
     },
-    changeEmail(){
+    changeEmail() {
       this.EmailCodeError = false
       this.ruleForm = {
         email: '',
@@ -196,7 +205,22 @@ export default {
 
 <template>
   <div class="bg w-full h-100vh flex justify-center items-center">
-    <div v-show="loading" class="absolute z-100 flex justify-center items-center h-100vh w-full bg-[#fff] opacity-60"><Loading class="z-100" /></div>
+    <div
+      v-show="loading"
+      class="
+        absolute
+        z-100
+        flex
+        justify-center
+        items-center
+        h-100vh
+        w-full
+        bg-[#fff]
+        opacity-60
+      "
+    >
+      <Loading class="z-100" />
+    </div>
     <div class="h-auto m-auto">
       <div class="w-404px h-auto rounded-8px p-24px bg-[#fff] loginBox">
         <h1 class="text-24px font-bold my-24px">Create account</h1>
@@ -217,6 +241,7 @@ export default {
               </el-input>
               <button
                 type="button"
+                :disabled = isDisabled
                 @click="sendEmail()"
                 class="
                   absolute
@@ -227,12 +252,13 @@ export default {
                   right-0px
                   border-1px border-[#1460F3]
                   text-[#1460F3]
-                  w-64px
+                  w-auto
+                  px-5px
                   h-24px
                   rounded-4px
                 "
               >
-                Send
+                {{ buttonName }}
               </button>
             </div>
           </el-form-item>
@@ -407,7 +433,9 @@ export default {
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="changeEmail">Change Email</el-button>
-        <el-button type="primary" @click="$router.push('/login')">Sign in</el-button>
+        <el-button type="primary" @click="$router.push('/login')"
+          >Sign in</el-button
+        >
       </span>
     </el-dialog>
   </div>
@@ -476,11 +504,11 @@ export default {
 }
 .el-message--success {
   margin-top: 90px !important;
-  background-color: #373A47 !important;
+  background-color: #373a47 !important;
   height: 36px;
   min-width: auto !important;
   padding: 12px !important;
-  p{
+  p {
     color: #fff !important;
   }
 }

+ 3 - 3
src/views/Dashboard.vue

@@ -337,7 +337,7 @@ export default {
           <option value="">Product</option>
           <option v-for="item in productList" :key="item.id" :value="item.code">{{ item.name }}</option>
         </select>
-        <div @click="getOverviewProduct" class="w-70px h-28px border-[#1460F3] border-1px rounded-4px px-10px py-4px text-14px leading-20px text-[#1460F3] cursor-pointer">Confirm</div>
+        <div @click="getOverviewProduct" class="w-70px h-28px border-[#1460F3] border-1px rounded-4px px-10px py-4px text-14px leading-20px text-[#1460F3] cursor-pointer hover:opacity-80">Confirm</div>
       </div>
       <div class="flex flex-wrap justify-between mt-24px">
         <div class="h-56px flex-1 bg-[#F6F7F9] border-[#D9D9D9] border-1px rounded-4px py-18px pl-24px pr-40px flex justify-between items-center mr-24px">
@@ -380,7 +380,7 @@ export default {
             <option value="3">Last 30 Days</option>
             <option value="4">This Month</option>
           </select>
-          <div @click="getChartStatistics()" class="w-70px h-28px border-[#1460F3] border-1px rounded-4px px-10px py-4px text-14px leading-20px text-[#1460F3] cursor-pointer">Confirm</div>
+          <div @click="getChartStatistics()" class="w-70px h-28px border-[#1460F3] border-1px rounded-4px px-10px py-4px text-14px leading-20px text-[#1460F3] cursor-pointer hover:opacity-80">Confirm</div>
         </div>
         <div></div>
       </div>
@@ -422,7 +422,7 @@ export default {
           <option value="">Product</option>
           <option v-for="item in productList" :key="item.id" :value="item.code">{{ item.name }}</option>
         </select>
-        <div @click="getTeamMemberData" class="w-70px h-28px border-[#1460F3] border-1px rounded-4px px-10px py-4px text-14px leading-20px text-[#1460F3] cursor-pointer">Confirm</div>
+        <div @click="getTeamMemberData" class="w-70px h-28px border-[#1460F3] border-1px rounded-4px px-10px py-4px text-14px leading-20px text-[#1460F3] cursor-pointer hover:opacity-80">Confirm</div>
       </div>
       <div class="flex flex-wrap justify-between mt-24px">
         <div class="h-56px bg-[#F6F7F9] border-[#D9D9D9] border-1px rounded-4px py-18px pl-24px pr-40px flex-auto flex justify-between items-center mr-24px">

+ 2 - 0
src/views/Device.vue

@@ -250,6 +250,7 @@ export default {
             rounded-4px
             ml-16px
             text-[#1460F3]
+            hover:opacity-80
           "
         >
           Confirm
@@ -272,6 +273,7 @@ export default {
         <el-table-column prop="operate" label="Operate">
           <template slot-scope="scope">
             <button
+              v-show="scope.row.status === 'Ativated'"
               @click="handleClick(scope.row)"
               type="text"
               class="

+ 1 - 0
src/views/LicenseManage.vue

@@ -278,6 +278,7 @@ const searchInfo = (val) => {
             rounded-4px
             ml-16px
             text-[#1460F3]
+            hover:opacity-80
           "
         >
           Confirm

+ 17 - 1
src/views/Login.vue

@@ -61,6 +61,11 @@ export default {
           post('/pdf-tech/login', formdata).then(
             (res) => {
               if (res.data.code === 200 && res.data.msg === '获取授权码成功') {
+                this.$message({
+                  type: 'success',
+                  duration: 5000,
+                  message: 'Sign in Success'
+                })
                 get(
                   '/pdf-tech/auth/getToken?code=' +
                     res.data.result
@@ -206,7 +211,7 @@ export default {
           </div>
         </el-form-item>
         <el-form-item>
-          <div class="flex justify-between !text-12px">
+          <div class="flex justify-between items-center !text-12px">
             <el-checkbox
               label="Keep me logged in"
               name="type"
@@ -248,6 +253,7 @@ export default {
 }
 .el-input::v-deep input {
   border: 0px !important;
+  padding-right: 30px;
   border-bottom: 1px solid #d9d9d9 !important;
   border-radius: 0 !important;
 }
@@ -269,4 +275,14 @@ export default {
   min-width: auto !important;
   padding: 12px !important;
 }
+.el-message--success {
+  margin-top: 90px !important;
+  background-color: #373a47 !important;
+  height: 36px;
+  min-width: auto !important;
+  padding: 12px !important;
+  p {
+    color: #fff !important;
+  }
+}
 </style>

+ 1 - 0
src/views/ManageAdmin.vue

@@ -176,6 +176,7 @@ const handleCurrentChange = (val) => {
             rounded-4px
             ml-16px
             text-[#1460F3]
+            hover:opacity-80
           "
         >
           Confirm

+ 2 - 2
src/views/Noadmin.vue

@@ -3,8 +3,8 @@ export default {}
 </script>
 
 <template>
-  <div class="bg-[#E7EAEE]">
-    <div class="h-81vw flex flex-col justify-center items-center">
+  <div class="bg-[#E7EAEE] h-100vh flex items-center justify-center">
+    <div class="flex flex-col justify-center items-center">
       <img src="@/assets/images/sorry.png" alt="" />
       <h1 class="text-28px leading-40px mt-16px">Sorry!</h1>
       <div class="w-360px leading-20px text-13px mt-16px flex flex-col items-center">

+ 1 - 0
src/views/ProductManagement.vue

@@ -109,6 +109,7 @@ const handleCurrentChange = (value) => {
             rounded-4px
             ml-16px
             text-[#1460F3]
+            hover:opacity-80
           "
         >
           Confirm

+ 3 - 1
src/views/Settings.vue

@@ -1,6 +1,7 @@
 <script>
 import { post, put } from '../../utils/request'
 import { country } from '../../utils/country.js'
+import { userStore } from '@/store/userInfo'
 
 export default {
   props: {
@@ -151,6 +152,7 @@ export default {
   },
   mounted() {
     this.country = country()
+    this.ruleForm.email = userStore().user.email
   }
 }
 </script>
@@ -207,7 +209,7 @@ export default {
         <el-form-item label="User Name" prop="userName">
           <div style="display: flex">
             <el-input
-              v-model.trim="ruleForm.userName"
+              v-model="ruleForm.userName"
               class="username"
               placeholder="User Name"
             >

+ 1 - 0
src/views/TeamManagement/ManageMember.vue

@@ -248,6 +248,7 @@ onMounted(() => {
             leading-20px
             text-[#1460F3]
             cursor-pointer
+            hover:opacity-80
           "
         >
           Confirm

+ 1 - 0
src/views/TeamManagement/ManageTeam.vue

@@ -219,6 +219,7 @@ onMounted(() => {
             leading-20px
             text-[#1460F3]
             cursor-pointer
+            hover:opacity-80
           "
         >
           Confirm

+ 1 - 1
src/views/VolumeCancel.vue

@@ -82,7 +82,7 @@ export default {
         </el-form-item>
         <el-form-item>
           <span slot="label" class="label leading-20px text-[#1460F3] hover:opacity-70 cursor-pointer">
-            <a href="/public/download/批量取消授权导入模板.xlsx" download="批量取消授权导入模板.xlsx">
+            <a href="/public/download/批量取消授权导入模板.xlsx" download="批量取消授权导入模板.xlsx" class="font-normal">
               Download sample XLSX <img src="@/assets/images/downLoadBlue.svg" class="inline-block ">
             </a>
           </span>

+ 0 - 1
utils/request.js

@@ -21,7 +21,6 @@ instance.interceptors.request.use(
      *  config.headers.token = token
      * }
      */
-    console.log(config)
     if(!(config.url.indexOf("pdf-tech/vppMember/create") !== -1 || config.url.indexOf("/pdf-tech/login") !== -1)){
       const token = cookies.get('accessToken')
       config.headers.Authorization = 'Bearer ' + token