@@ -54,6 +54,7 @@ import { useUserStore } from '@/stores';
const store = useUserStore();
const formRef = ref();
+const inputRef = ref();
const visible = ref(false);
const timer = ref();
const isLegalMobile = ref(false);
@@ -112,6 +113,9 @@ const canGetCaptcha = computed(() => {
// 打开弹窗
const open = () => {
visible.value = true;
+ nextTick(() => {
+ inputRef.value?.focus();
+ });
};
// 发送验证码
diff --git a/src/views/components/management/person/components/change-name-modal/index.vue b/src/views/components/management/person/components/change-name-modal/index.vue
index 97984a6..b7c54fe 100644
--- a/src/views/components/management/person/components/change-name-modal/index.vue
+++ b/src/views/components/management/person/components/change-name-modal/index.vue
@@ -10,7 +10,7 @@
>
@@ -29,6 +29,7 @@ import { useUserStore } from '@/stores';
const store = useUserStore();
const formRef = ref();
+const inputRef = ref();
const visible = ref(false);
const submitLoading = ref(false);
const form = ref({
@@ -39,6 +40,10 @@ const form = ref({
const open = (userName) => {
form.value.name = userName;
visible.value = true;
+
+ nextTick(() => {
+ inputRef.value?.focus();
+ });
};
// 确定按钮点击
diff --git a/src/views/components/management/person/components/change-password-modal/index.vue b/src/views/components/management/person/components/change-password-modal/index.vue
index ab71f64..c9eba78 100644
--- a/src/views/components/management/person/components/change-password-modal/index.vue
+++ b/src/views/components/management/person/components/change-password-modal/index.vue
@@ -57,6 +57,12 @@
+
+
@@ -64,8 +70,10 @@
import { computed, ref } from 'vue';
import { Button, Form, FormItem, Input, message, Modal } from 'ant-design-vue';
import VerificationCode from '../verification-code/index.vue';
+import PuzzleVerification from '@/views/login/components/PuzzleVerification.vue';
import { postUpdatePasswordCaptcha, postUpdatePassword } from '@/api/all/login';
+import { postClearRateLimiter } from '@/api/all/common';
import icon1 from '@/assets/img/login/icon-close.png';
import icon2 from '@/assets/img/login/icon-open.png';
@@ -75,7 +83,7 @@ const visible = ref(false);
const phone = ref('');
const isCheckPass = ref(false);
const formRef = ref(null);
-
+const isVerificationVisible = ref(false);
// 验证码输入相关
const countdown = ref(0);
const timer = ref(null);
@@ -146,9 +154,20 @@ const getCaptcha = async () => {
// 重置倒计时
countdown.value = 0;
clearInterval(timer.value);
+
+ if (error.status === 429) {
+ isVerificationVisible.value = true;
+ }
}
};
+const handleVerificationSubmit = async () => {
+ isVerificationVisible.value = false;
+ verificationCodeRef.value?.init();
+ await postClearRateLimiter();
+ getCaptcha();
+};
+
// 开始倒计时
const startCountdown = () => {
countdown.value = 60;
diff --git a/src/views/components/management/person/components/change-password-modal/style.scss b/src/views/components/management/person/components/change-password-modal/style.scss
index aa2630c..b1fb1dc 100644
--- a/src/views/components/management/person/components/change-password-modal/style.scss
+++ b/src/views/components/management/person/components/change-password-modal/style.scss
@@ -45,6 +45,8 @@
.ant-input-affix-wrapper {
border-radius: 8px !important;
+
+
}
}
}
diff --git a/src/views/components/management/person/components/verification-code/index.vue b/src/views/components/management/person/components/verification-code/index.vue
index f586963..0e2b762 100644
--- a/src/views/components/management/person/components/verification-code/index.vue
+++ b/src/views/components/management/person/components/verification-code/index.vue
@@ -127,6 +127,8 @@ defineExpose({ init });
border: 1px solid #d7d7d9;
outline: none;
+ caret-color: #6d4cfe;
+
&:hover {
border-color: #6d4cfe !important;
}
diff --git a/src/views/components/management/person/index.vue b/src/views/components/management/person/index.vue
index 2914712..e44ddcd 100644
--- a/src/views/components/management/person/index.vue
+++ b/src/views/components/management/person/index.vue
@@ -137,21 +137,6 @@ const changePasswordModalRef = ref(null);
const changeNameModalRef = ref(null);
const changeMobileModalRef = ref(null);
-// const userInfo = computed(() => {
-// return store.userInfo ?? {};
-// });
-
-const columns = [
- {
- title: '用户信息',
- slotName: 'info',
- },
- {
- title: '手机号',
- slotName: 'mobile',
- },
-];
-
const infoVisible = ref(false);
const imageVisible = ref(false);
const mobileVisible = ref(false);
@@ -290,18 +275,6 @@ async function handleVerificationSubmit() {
beginCountdown();
}
-async function handleUpdateMobile() {
- if (!isSendCaptcha.value) {
- message.error('请先获取验证码!');
- return false;
- }
- const res = await formRef.value.validate();
- if (res === true || res === undefined) {
- await updateMobile(form);
- message.success('修改成功!');
- }
-}
-
function getFileExtension(filename: string): string {
const match = filename.match(/\.([^.]+)$/);
return match ? match[1].toLowerCase() : '';