fix: captcha types
parent
6cb908e688
commit
f73436e94f
|
@ -32,16 +32,16 @@
|
||||||
"@vben/types": "workspace:*",
|
"@vben/types": "workspace:*",
|
||||||
"@vueuse/core": "catalog:",
|
"@vueuse/core": "catalog:",
|
||||||
"@vueuse/integrations": "catalog:",
|
"@vueuse/integrations": "catalog:",
|
||||||
|
"crypto-js": "catalog:",
|
||||||
"qrcode": "catalog:",
|
"qrcode": "catalog:",
|
||||||
"tippy.js": "catalog:",
|
"tippy.js": "catalog:",
|
||||||
"vue": "catalog:",
|
"vue": "catalog:",
|
||||||
"vue-json-viewer": "catalog:",
|
"vue-json-viewer": "catalog:",
|
||||||
"vue-router": "catalog:",
|
"vue-router": "catalog:",
|
||||||
"vue-tippy": "catalog:",
|
"vue-tippy": "catalog:"
|
||||||
"crypto-js": "catalog:"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/qrcode": "catalog:",
|
"@types/crypto-js": "catalog:",
|
||||||
"@types/crypto-js": "catalog:"
|
"@types/qrcode": "catalog:"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import type { ComponentInternalInstance } from 'vue';
|
||||||
|
|
||||||
import type { VerificationProps } from '../types';
|
import type { VerificationProps } from '../types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
type ComponentInternalInstance,
|
|
||||||
getCurrentInstance,
|
getCurrentInstance,
|
||||||
nextTick,
|
nextTick,
|
||||||
onMounted,
|
onMounted,
|
||||||
|
@ -20,44 +21,6 @@ import { resetSize } from '../utils/util';
|
||||||
* VerifyPoints
|
* VerifyPoints
|
||||||
* @description 点选
|
* @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,
|
|
||||||
// },
|
|
||||||
// // 弹出式pop,固定fixed
|
|
||||||
// mode: {
|
|
||||||
// default: 'fixed',
|
|
||||||
// type: String,
|
|
||||||
// },
|
|
||||||
// // 间隔
|
|
||||||
// vSpace: {
|
|
||||||
// default: 5,
|
|
||||||
// type: Number,
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'VerifyPoints',
|
name: 'VerifyPoints',
|
||||||
});
|
});
|
||||||
|
@ -127,7 +90,7 @@ onMounted(() => {
|
||||||
const canvas = ref(null);
|
const canvas = ref(null);
|
||||||
|
|
||||||
// 获取坐标
|
// 获取坐标
|
||||||
const getMousePos = function (obj: any, e: any) {
|
const getMousePos = function (_obj: any, e: any) {
|
||||||
const x = e.offsetX;
|
const x = e.offsetX;
|
||||||
const y = e.offsetY;
|
const y = e.offsetY;
|
||||||
return { x, y };
|
return { x, y };
|
||||||
|
@ -190,7 +153,7 @@ function canvasClick(e: any) {
|
||||||
if (res.repCode === '0000') {
|
if (res.repCode === '0000') {
|
||||||
barAreaColor.value = '#4cae4c';
|
barAreaColor.value = '#4cae4c';
|
||||||
barAreaBorderColor.value = '#5cb85c';
|
barAreaBorderColor.value = '#5cb85c';
|
||||||
text.value = $t('ui.captcha.success');
|
text.value = $t('ui.captcha.sliderSuccessText');
|
||||||
bindingClick.value = false;
|
bindingClick.value = false;
|
||||||
if (mode.value === 'pop') {
|
if (mode.value === 'pop') {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -227,7 +190,7 @@ async function getPictrue() {
|
||||||
backToken.value = res.data.repData.token;
|
backToken.value = res.data.repData.token;
|
||||||
secretKey.value = res.data.repData.secretKey;
|
secretKey.value = res.data.repData.secretKey;
|
||||||
poinTextList.value = res.data.repData.wordList;
|
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 {
|
} else {
|
||||||
text.value = res?.data?.repMsg;
|
text.value = res?.data?.repMsg;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue