This commit is contained in:
zhangjialei2
2024-11-14 08:40:04 +08:00
commit 0e21fc3287
73 changed files with 17061 additions and 0 deletions

View 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();
}

View 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)
}
})
})
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

36
pages/index/index.vue Normal file
View 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>