创建
This commit is contained in:
11
pages/components/verify/utils/ase.js
Normal file
11
pages/components/verify/utils/ase.js
Normal file
@ -0,0 +1,11 @@
|
||||
import CryptoJS from 'crypto-js'
|
||||
/**
|
||||
* @word 要加密的内容
|
||||
* @keyWord String 服务器随机返回的关键字
|
||||
* */
|
||||
export function aesEncrypt(word,keyWord="XwKsGlMcdPMEhR1B"){
|
||||
var key = CryptoJS.enc.Utf8.parse(keyWord);
|
||||
var srcs = CryptoJS.enc.Utf8.parse(word);
|
||||
var encrypted = CryptoJS.AES.encrypt(srcs, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});
|
||||
return encrypted.toString();
|
||||
}
|
19
pages/components/verify/utils/request.js
Normal file
19
pages/components/verify/utils/request.js
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
// let baseUrl = "https://captcha.anji-plus.com/captcha-api"
|
||||
let baseUrl = "http://10.108.11.46:8088"
|
||||
|
||||
export const myRequest = (option={})=>{
|
||||
return new Promise((reslove,reject)=>{
|
||||
uni.request({
|
||||
url: baseUrl + option.url,
|
||||
data :option.data,
|
||||
method:option.method || "GET",
|
||||
success: (result) => {
|
||||
reslove(result)
|
||||
},
|
||||
fail:(error)=>{
|
||||
reject(error)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
482
pages/components/verify/verify.vue
Normal file
482
pages/components/verify/verify.vue
Normal file
File diff suppressed because one or more lines are too long
554
pages/components/verify/verifyPoint/verifyPoint.vue
Normal file
554
pages/components/verify/verifyPoint/verifyPoint.vue
Normal file
File diff suppressed because one or more lines are too long
634
pages/components/verify/verifySlider/verifySlider.vue
Normal file
634
pages/components/verify/verifySlider/verifySlider.vue
Normal file
File diff suppressed because one or more lines are too long
36
pages/index/index.vue
Normal file
36
pages/index/index.vue
Normal file
@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<view>
|
||||
<Verify
|
||||
@success="'success'"
|
||||
:mode="'pop'"
|
||||
:captchaType="'blockPuzzle'"
|
||||
:imgSize="{ width: '330px', height: '155px' }"
|
||||
ref="verify"
|
||||
></Verify>
|
||||
|
||||
<button @click="useVerify">调用验证组件</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
****注: mode为"pop"时,使用组件需要给组件添加ref值,并且手动调用show方法 例: this.$refs.verify.show()**** <br/>
|
||||
****注: mode为"fixed"时,无需添加ref值,无需调用show()方法****
|
||||
|
||||
<script>
|
||||
//引入组件
|
||||
import Verify from "../components/verify/verify.vue";
|
||||
export default {
|
||||
name: 'app',
|
||||
components: {
|
||||
Verify
|
||||
},
|
||||
|
||||
methods:{
|
||||
success(params){
|
||||
// params 返回的二次验证参数, 和登录参数一起回传给登录接口,方便后台进行二次验证
|
||||
},
|
||||
useVerify(){
|
||||
this.$refs.verify.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user