|
@@ -24,7 +24,7 @@
|
|
|
:placeholder="t('sys.login.password')"
|
|
:placeholder="t('sys.login.password')"
|
|
|
/>
|
|
/>
|
|
|
</FormItem>
|
|
</FormItem>
|
|
|
-
|
|
|
|
|
|
|
+ <BasicDragVerify @success="handleSuccess" :successText="successText" width="404px" />
|
|
|
<ARow class="enter-x">
|
|
<ARow class="enter-x">
|
|
|
<ACol :span="12">
|
|
<ACol :span="12">
|
|
|
<FormItem>
|
|
<FormItem>
|
|
@@ -101,6 +101,7 @@
|
|
|
import { LoginStateEnum, useLoginState, useFormRules, useFormValid } from './useLogin';
|
|
import { LoginStateEnum, useLoginState, useFormRules, useFormValid } from './useLogin';
|
|
|
import { useDesign } from '/@/hooks/web/useDesign';
|
|
import { useDesign } from '/@/hooks/web/useDesign';
|
|
|
//import { onKeyStroke } from '@vueuse/core';
|
|
//import { onKeyStroke } from '@vueuse/core';
|
|
|
|
|
+ import { BasicDragVerify, DragVerifyActionType, PassingData } from '/@/components/Verify/index';
|
|
|
|
|
|
|
|
const ACol = Col;
|
|
const ACol = Col;
|
|
|
const ARow = Row;
|
|
const ARow = Row;
|
|
@@ -132,6 +133,13 @@
|
|
|
async function handleLogin() {
|
|
async function handleLogin() {
|
|
|
const data = await validForm();
|
|
const data = await validForm();
|
|
|
if (!data) return;
|
|
if (!data) return;
|
|
|
|
|
+ if (!verifyPass) {
|
|
|
|
|
+ createErrorModal({
|
|
|
|
|
+ title: t('sys.api.errorTip'),
|
|
|
|
|
+ content: '请进行滑动验证',
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
try {
|
|
try {
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
|
const userInfo = await userStore.login({
|
|
const userInfo = await userStore.login({
|
|
@@ -156,4 +164,12 @@
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ let verifyPass = false;
|
|
|
|
|
+ const successText = ref('验证通过');
|
|
|
|
|
+ function handleSuccess(data: PassingData) {
|
|
|
|
|
+ verifyPass = true;
|
|
|
|
|
+ const { time } = data;
|
|
|
|
|
+ successText.value = `验证通过,耗时${time}秒`;
|
|
|
|
|
+ }
|
|
|
</script>
|
|
</script>
|