npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tianai-capthcha-cfmoto-vue

v1.0.1

Published

天爱友情滑动验证码Vue版 For CFMOTO

Readme

tianai-capthcha-cfmoto-vue

天爱友情滑动验证码Vue版 For CFMOTO

一、快速开始

安装

npm install -S tianai-capthcha-cfmoto-vue

使用说明

  • 滑块验证码

<template>
  <div class="section-slider">
    <TianaiCaptchaSlider v-model="showCaptcha" theme="cfmoto" :request-config="getGenData" :request-check="requestCheck"></TianaiCaptchaSlider>
  </div>
</template>
<script>
import { TianaiCaptchaSlider } from 'tianai-capthcha-cfmoto-vue';
import { commonCodeGenrateApi, commonCodeSendCodeV2Api } from '@/api/common';

export default {
  props: {},
  components: { TianaiCaptchaSlider },
  data() {
    return {
      showCaptcha: false,
    };
  },
  computed: {},
  methods: {
    async getGenData() {
      const params = {};
      const resData = await commonCodeGenrateApi(params);
      const data = resData.data || {};
      const id = data.imageCaptchaId;
      const captcha = {
        backgroundImage: data.backgroundImage,
        backgroundImageHeight: 360,
        backgroundImageTag: 'default',
        backgroundImageWidth: 600,
        data: null,
        templateImage: data.sliderImage,
        templateImageHeight: 360,
        templateImageTag: 'default',
        templateImageWidth: 110,
        type: 'SLIDER',
      };
      return { id, captcha };
    },
    async requestCheck(id, data, vm) {
      try {
        console.log(vm);
        const idcard = '19521592154';
        const idcardType = 'phone';
        const startSlidingTime = this.$dayjs(data.startSlidingTime).valueOf();
        const endSlidingTime = this.$dayjs(data.endSlidingTime).valueOf();
        const imageCaptchaTrackBO = { ...data, startSlidingTime, endSlidingTime };
        const areaCode = '86';
        const params = { areaCode, idcardType, idcard, imageCaptchaId: id, imageCaptchaTrackBO };
        const resData = await commonCodeSendCodeV2Api(params);

        if (resData.code * 1) {
          vm.showTips(resData.msg || '验证失败,请重新尝试!', 0);
          setTimeout(() => {
            vm.reload();
          }, 1000);
          return;
        }
        const useTimes = (data.endSlidingTime - data.startSlidingTime) / 1000;
        vm.showTips(`验证成功,耗时${useTimes}秒`, 1);
        setTimeout(() => {
          vm.destroy();
        }, 1000);
      } catch (error) {
        vm.showTips('验证码被黑洞吸走了!', 0);
        setTimeout(() => {
          vm.reload();
        }, 1000);
        throw new Error(error);
      }
    },
    async getAll() {
      this.showCaptcha = true;
    },
    emitChange(type, e) {
      console.log(type, e);
    },
  },
  created() {},
  mounted() {
    this.getAll();
  },
  beforeUnmount() {},
  watch: {},
};
</script>
<style lang="scss" scoped>
.section-slider {
  margin: 20px auto;
  box-sizing: border-box;
  // box-shadow: 0 0 11px 0 #999;
  width: 335px;
  // height: 318px;
  // padding: 20px;
  // overflow: hidden;
  position: relative;
  // z-index: 997;
  // box-sizing: border-box;
  // border-radius: 5px;
}
</style>

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request