编写后台登录滑动成功获取验证码 人机验证

news/2024/7/9 23:59:23 标签: vue, 后台系统

vuepuzzlevcode_0">vue-puzzle-vcode

Vue 纯前端的拼图人机验证、右滑拼图验证

vuepuzzlevcode_2">安装vue-puzzle-vcode

 npm install vue-puzzle-vcode --save

vuepuzzlevcode_6">使用vue-puzzle-vcode

import Vcode from "vue-puzzle-vcode";

<Vcode :show="isShow" @success="onSuccess" @close="onClose" />

自己使用插件的dom

<template>
  <div class="login-container">
    <div class="login-card">
        <div class="fonz">手机验证码</div>
        <div class="flex" style="padding-right: ">
          <input
            type="text"
            placeholder="请输入手机验证码"
            style="padding-left: 0px !important"
          />
          <span
            style="color: rgba(90, 181, 242, 1); font-size: 14px"
            @click="sendCode"
            >{{ codeButtonText }}</span
          >
        </div>
      </div>
      <Vcode :show="isShow" @success="onSuccess" @close="isShow = false" />
  </div>
</template>

<script>
import Vcode from "vue-puzzle-vcode";
export default {
  components: {
    Vcode,
  },
  data() {
    return {
      isShow: false,
    };
  },
  methods: {
 
    // 发送验证码
    sendCode() {
      console.log(this.codeSending);
      if (!this.codeSending) {
        this.isShow = true;
      }
    },
    onSuccess(msg) {
      this.isShow = false; // 通过验证后,需要手动关闭模态框
      // 实现发送验证码的逻辑
      // 可以使用定时器模拟发送过程
      this.codeSending = true;
      let count = 60;
      const timer = setInterval(() => {
        count--;
        if (count === 0) {
          clearInterval(timer);
          this.codeSending = false;
          this.codeButtonText = "重新获取";
        } else {
          this.codeButtonText = `重新获取 ${count}s`;
        }
      }, 1000);
    },
  },
};
</script>

<style lang="scss" scoped>
.hh {
  font-size: 20px;
  font-weight: 700;
  line-height: 23px;
  color: rgba(51, 51, 51, 1);
  text-align: center;
  vertical-align: top;
  margin-bottom: 20px;
  height: 30px;
}
input {
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  padding: 0;
  margin: 0;
  border-radius: 0;
  outline: none;
  flex: 1;
  padding-left: 20px !important;
}
.flex {
  display: flex;
  align-items: center;
  height: 30px;
  justify-content: space-between;
  margin-bottom: 30px;
  border-bottom: 2px solid rgba(227, 227, 227, 1);
}
.fonz {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0px;
  line-height: 19.21px;
  color: rgba(31, 32, 38, 1);
  text-align: left;
  vertical-align: top;
  margin-bottom: 17px;
}
::v-deep {
  .el-checkbox__inner::after {
    left: 5px;
    top: 2px;
  }
  .el-checkbox__inner {
    width: 17px;
    height: 17px;
    border-radius: 8px;
  }
  .el-checkbox__inner:hover {
    border-color: #dcdfe6 !important;
  }
  .el-checkbox__input.is-checked + .el-checkbox__label {
    color: #28b0a6 !important;
  }

  .el-checkbox__input.is-checked .el-checkbox__inner {
    background-color: #28b0a6;
  }
  .el-menu-item:hover {
    background-color: #f6f6f6 !important;
  }
  .el-tabs__nav-wrap::after {
    display: none !important;
  }
  .el-tabs__item:hover {
    color: #28b0a6 !important;
    cursor: pointer;
  }

  .el-tabs__item.is-active {
    color: #28b0a6;
  }

  .el-tabs__active-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background-color: #28b0a6 !important;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    list-style: none;
  }
}
.login-container {
  background-color: #f6f6f6;
  display: flex;
  width: 100vw;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-image: url("../.././assets/backc.png");
  // background-size: cover;
  background-repeat: no-repeat;
}

.login-card {
  position: fixed;
  left: 1297px;
  top: 204px;
  width: 385px;
  padding: 47px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.login-title {
  margin-bottom: 20px;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
}
.login-button {
  width: 100%;
  margin-bottom: 20px;
  background-color: #28b0a6;
}

.login-links {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 48px;
  font-size: 14px;
  font-weight: 400;

  a {
    color: rgba(90, 181, 242, 1);
    text-align: center;
    vertical-align: middle;
    text-decoration: none;
  }
}

.register-link,
.forgot-password-link {
  color: #666;
}
.agreement {
  font-size: 14px;
  span {
    margin-left: 10px;
  }
  a {
    font-size: 14px;
    font-weight: 400;
    color: rgba(90, 181, 242, 1);
    text-align: center;
    text-decoration: none;
  }
}
</style>


在这里插入图片描述
在这里插入图片描述


http://www.niftyadmin.cn/n/5109474.html

相关文章

AUTOSAR AP 硬核知识点梳理(3)AUTOSAR AP 方法论和开发流程的最佳实践

一 Adaptive AUTOSAR 方法论 AUTOSAR AP开发方法论包括三个主要阶段,分别是: 1、架构和设计阶段: 在这个阶段,您需要确定系统的需求、功能和服务,并将它们分配到合适的Machine上。 根据个人习惯使用一些建模工具,例如[Simulink]、[ProVision]或[RTA-VRTE SDK]自带的DS…

【Linux07-进程间通信】侧重 管道 和 SystemV 的进程间通信讲解

今天&#xff0c;带来Linux下的进程间通信讲解。文中不足错漏之处望请斧正&#xff01; 是什么 进程间通信&#xff0c;Inter-Process Communication(IPC)&#xff1a; 进程间通过访问同一块内存空间来进行数据的交流。 为什么 为什么要有IPC&#xff0c;它的作用是什么&am…

2020年江西省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书样题

2020年江西省职业院校技能大赛高职组 “信息安全管理与评估”赛项任务书 样题 赛项时间 9:00-12:00&#xff0c;共计3小时。 赛项信息 赛项内容 竞赛阶段 任务阶段 竞赛任务 竞赛时间 分值 第一阶段 平台搭建与安全设备配置防护 任务1 网络平台搭建 9:00-12:00 1…

【探索Linux】文件描述符 | 重定向 | 基础IO —— 强大的命令行工具 P.12

阅读导航 前言一、open()函数返回值二、文件描述符fd1. 文件描述符的分配规则2. 文件描述符0、1、2 三、重定向1. 重定向的本质⭕图解 2. dup2 系统调用函数 温馨提示 前言 前面我们讲了C语言的基础知识&#xff0c;也了解了一些数据结构&#xff0c;并且讲了有关C的一些知识&…

设置Oracle环境变量

打开系统变量 1.ORACLE_HOME&#xff1a; 新建一个变量home&#xff0c;再在path中添加&#xff1a;%ORACLE_HOME%\BIN 变量名&#xff1a; ORACLE_HOME 变量值&#xff1a; D:\app\chenzhi\product\11.2.0\dbhome_2&#xff08;自己的存放地址&#xff09; 2.NLS_LANG&am…

css3实现图片瀑布流,根据屏幕大小列可变和不可变的的瀑布流

前提是每张图片宽度要设置成一样,准备15张图测试 <div class"img-main"><div><img src"/assets/images/sq/1.jpg" alt"" title"1"></div><div><img src"/assets/images/sq/2.jpg" alt&quo…

el-input无法输入的问题和表单验证失败问题(亲测有效)-开发bug总结4

大部分无法输入的问题&#xff1a;基本都是没有进行v-model双向数据绑定&#xff0c;这个很好解决。 本人项目中遇到的bug问题如下&#xff1a; 点击添加&#xff0c;表单内可输入用户名 和 用户姓名&#xff0c;但有时会偶发出现无法这两个input框里面无法输入内容。 原因&a…

ntfs读写工具Tuxera NTFS2023激活码

Tuxera NTFS for Mac是一款mac系统读写工具,Tuxera让Mac OS支持NTFS 格式文件读写,支持所有移动硬盘、U盘等外接设备,同时Tuxera用户可以简单直观的在Mac机上随意对NTFS文件修改、 在 Mac 上打开、编辑、复制、移动或删除存储在 Windows NTFS 格式 USB 驱动器上的文件。当您获…