1. webkf-core-authentication

webkf-core-authentication

npm install webkf-core-authentication -S --registry http://192.168.0.165:4873

滑动图片验证组件说明

执行命令:npm install webkf-core-authentication -S --registry http://192.168.0.165:4873

下载完成后引入并注册组件

 import SlideVerify from 'webkf-core-authentication'

    components:{
      SlideVerify
    },

在template里直接使用即可

     <SlideVerify
     ref="slideVerify"
     @success="Success"
     >
     </SlideVerify>

自定义回调函数

| success  | 验证码匹配成功的回调  |

调用组件内的方法

在前台验证通过后调用

 this.$refs.slideVerify.loaIsShow()
         dlOnclick(){//假设这是前台验证方法
            if(this.userName==='' || this.passWord===''){
                this.$message({
                message: '请正确输入账号和密码',
                type: 'warning'
                })
            }else{
                this.$refs.slideVerify.loaIsShow()
            }
        }

在后台验证通过调用

 this.$refs.slideVerify.setItemTrue()//账号密码正确调用的函数

在后台验证失败调用

 this.$refs.slideVerify.setItemFalse()//账号密码不正确调用的函数

在success回调中调用您的后台验证方法

 Success(){//验证码匹配成功的回调
    this.verification()//假设这是后台验证通过或失败的方法
}