feat: add verification comp【31315a7f】
parent
3fc27ff171
commit
111c0eb93f
|
@ -1,9 +1,8 @@
|
|||
<script lang="ts" setup>
|
||||
import type { ComponentInternalInstance } from 'vue';
|
||||
|
||||
import type { VerificationProps } from '../types';
|
||||
|
||||
import {
|
||||
type ComponentInternalInstance,
|
||||
getCurrentInstance,
|
||||
nextTick,
|
||||
onMounted,
|
||||
|
@ -21,6 +20,44 @@ 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,
|
||||
// },
|
||||
// // 弹出式pop,固定fixed
|
||||
// mode: {
|
||||
// default: 'fixed',
|
||||
// type: String,
|
||||
// },
|
||||
// // 间隔
|
||||
// vSpace: {
|
||||
// default: 5,
|
||||
// type: Number,
|
||||
// },
|
||||
// });
|
||||
|
||||
defineOptions({
|
||||
name: 'VerifyPoints',
|
||||
});
|
||||
|
@ -90,7 +127,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 };
|
||||
|
@ -153,7 +190,7 @@ function canvasClick(e: any) {
|
|||
if (res.repCode === '0000') {
|
||||
barAreaColor.value = '#4cae4c';
|
||||
barAreaBorderColor.value = '#5cb85c';
|
||||
text.value = $t('ui.captcha.sliderSuccessText');
|
||||
text.value = $t('ui.captcha.success');
|
||||
bindingClick.value = false;
|
||||
if (mode.value === 'pop') {
|
||||
setTimeout(() => {
|
||||
|
@ -190,7 +227,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.clickInOrder')}【${poinTextList.value.join(',')}】`;
|
||||
text.value = `${$t('ui.captcha.point')}【${poinTextList.value.join(',')}】`;
|
||||
} else {
|
||||
text.value = res?.data?.repMsg;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue