diff --git a/app/components/YourPuzzleComponent.vue b/app/components/YourPuzzleComponent.vue deleted file mode 100644 index 2a91174..0000000 --- a/app/components/YourPuzzleComponent.vue +++ /dev/null @@ -1,367 +0,0 @@ - - - - - - - - {{ verifyTip }} - - - - - - - - - - - - - - - - - - diff --git a/app/components/puzzleComponent/index.vue b/app/components/puzzleComponent/index.vue new file mode 100644 index 0000000..5ba0714 --- /dev/null +++ b/app/components/puzzleComponent/index.vue @@ -0,0 +1,195 @@ + + + + + + + + + + {{ verifyStatus.message }} + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/pages/login/index.vue b/app/pages/login/index.vue index 424a1c2..9519ec5 100644 --- a/app/pages/login/index.vue +++ b/app/pages/login/index.vue @@ -8,7 +8,9 @@ import {authStore} from "@/stores/auth/index.js"; import {message} from '@/components/x-message/useMessage.js' import {fddCheck} from "~/api/goods/index.js"; import zu6020 from '@/static/images/zu6020@2x.png' -import YourPuzzleComponent from '@/components/YourPuzzleComponent.vue' + +import PuzzleComponent from '@/components/puzzleComponent/index.vue' +import { ref } from 'vue'; const {userInfo,token,selectedZone}= authStore() const router = useRouter(); const route = useRoute(); @@ -84,27 +86,26 @@ onMounted(()=>{ selectedCountry.value=route.query.countryName || defaultCountry.name }) const vanSwipeRef=ref(null) + const captcha=ref({ - "nonceStr": "397b5e08168c31c4", -"blockX": 256 + nonceStr: "", +blockX: 256 , +blockWidth:50, +blockHeight:50, +canvasWidth:320, +canvasHeight:191, +place:0, +canvasSrc:'', +blockSrc:'', +blockY:0 }) -const captchaUrl=ref('') -const captchaVerifyUrl=ref('') -const blockY=ref(0) const getCode =async () => { loadingRef.value.loading1=true - const res=await userCaptcha({ -"canvasWidth": 320, //画布的宽度(canvasWidth大于41并且(canvasWidth-10)/2 - 1> blockWidth) -"canvasHeight": 191, //画布的高度(canvasHeight大于26并且 canvasHeight - blockHeight > 11 -"blockWidth": 50, //块图像的宽度(blockWidth大于14) -"blockHeight": 50, //块图像的高度(blockHeight大于14) -// "blockRadius": 25, //块图像的圆角半径 -"place": 0 //图像来源标识,0表示URL下载,1表示本地文件 一般用0 - }) + const res=await userCaptcha(captcha.value) if (res.status===0){ - captchaUrl.value=`data:image/png;base64,${res.data.canvasSrc}` - captchaVerifyUrl.value=`data:image/png;base64,${res.data.blockSrc}` - blockY.value=res.data.blockY + captcha.value.canvasSrc=`data:image/png;base64,${res.data.canvasSrc}` + captcha.value.blockSrc=`data:image/png;base64,${res.data.blockSrc}` + captcha.value.blockY=res.data.blockY captcha.value.nonceStr=res.data.nonceStr isShow.value=true loadingRef.value.loading1=false @@ -286,10 +287,8 @@ const onLeave =async (moveX, callback) => { {{ $t('login.agreement') }}{{ $t('login.privacyPolicy') }} -