🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

if-captcha

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

if-captcha

安全验证滑块服务插件(Vue2/Vue3)

npmnpm
Version
2.0.7
Version published
Weekly downloads
29
11.54%
Maintainers
1
Weekly downloads
 
Created
Source

如何使用

npm install if-captcha

For Vue 3

//main.js
import IfCaptcha from 'if-captcha'
app.use(IfCaptcha)

setup中使用

import {useCaptcha} from 'if-captcha'

setup(){
    let $ = useCaptcha();
    const captcha = async () => {
        let res = await $.verify({
            captchaGetUrl: '/captcha/get',
            captchaCheckUrl: '/captcha/check',
            });
        if(res) {
            alert('验证成功')
        } else {
            alert('验证失败')
        }
    }

    return {
        captcha
    };
}

For Vue 2

//main.js
import IfCaptcha from 'if-captcha'

Vue.use(IfCaptcha)
async captcha(){
    let res = await this.$ifCaptcha.verify({
        captchaGetUrl: '/captcha/get',
        captchaCheckUrl: '/captcha/check',
        });
    if(res) {
        alert('验证成功')
    } else {
        alert('验证失败')
    }
}

Keywords

Vue

FAQs

Package last updated on 26 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts