fix: captcha types

pull/71/head
xingyu4j 2025-04-07 11:23:32 +08:00
parent 6cb908e688
commit f73436e94f
2 changed files with 9 additions and 46 deletions

View File

@ -32,16 +32,16 @@
"@vben/types": "workspace:*",
"@vueuse/core": "catalog:",
"@vueuse/integrations": "catalog:",
"crypto-js": "catalog:",
"qrcode": "catalog:",
"tippy.js": "catalog:",
"vue": "catalog:",
"vue-json-viewer": "catalog:",
"vue-router": "catalog:",
"vue-tippy": "catalog:",
"crypto-js": "catalog:"
"vue-tippy": "catalog:"
},
"devDependencies": {
"@types/qrcode": "catalog:",
"@types/crypto-js": "catalog:"
"@types/crypto-js": "catalog:",
"@types/qrcode": "catalog:"
}
}

View File

@ -1,8 +1,9 @@
<script lang="ts" setup>
import type { ComponentInternalInstance } from 'vue';
import type { VerificationProps } from '../types';
import {
type ComponentInternalInstance,
getCurrentInstance,
nextTick,
onMounted,
@ -20,44 +21,6 @@ import { resetSize } from '../utils/util';
* VerifyPoints
* @description 点选
*/
// const props = defineProps({
// barSize: {
// default() {
// return {
// height: '40px',
// width: '310px',
// };
// },
// type: Object,
// },
// captchaType: {
// default() {
// return 'VerifyPoints';
// },
// type: String,
// },
// imgSize: {
// default() {
// return {
// height: '155px',
// width: '310px',
// };
// },
// type: Object,
// },
// // popfixed
// mode: {
// default: 'fixed',
// type: String,
// },
// //
// vSpace: {
// default: 5,
// type: Number,
// },
// });
defineOptions({
name: 'VerifyPoints',
});
@ -127,7 +90,7 @@ onMounted(() => {
const canvas = ref(null);
//
const getMousePos = function (obj: any, e: any) {
const getMousePos = function (_obj: any, e: any) {
const x = e.offsetX;
const y = e.offsetY;
return { x, y };
@ -190,7 +153,7 @@ function canvasClick(e: any) {
if (res.repCode === '0000') {
barAreaColor.value = '#4cae4c';
barAreaBorderColor.value = '#5cb85c';
text.value = $t('ui.captcha.success');
text.value = $t('ui.captcha.sliderSuccessText');
bindingClick.value = false;
if (mode.value === 'pop') {
setTimeout(() => {
@ -227,7 +190,7 @@ async function getPictrue() {
backToken.value = res.data.repData.token;
secretKey.value = res.data.repData.secretKey;
poinTextList.value = res.data.repData.wordList;
text.value = `${$t('ui.captcha.point')}${poinTextList.value.join(',')}`;
text.value = `${$t('ui.captcha.clickInOrder')}${poinTextList.value.join(',')}`;
} else {
text.value = res?.data?.repMsg;
}