From 98d600693a4625ece8d646d54f62ba22c1905fb8 Mon Sep 17 00:00:00 2001 From: rd <1344903914@qq.com> Date: Fri, 12 Sep 2025 12:00:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/all/index.ts | 2 +- src/api/all/login.ts | 16 ++ .../components/change-mobile-modal/index.vue | 41 ++-- .../components/change-name-modal/index.vue | 20 +- .../change-password-modal/index.vue | 212 ++++++++++++++++++ .../change-password-modal/style.scss | 60 +++++ .../components/verification-code/index.vue | 154 +++++++++++++ .../components/management/person/index.vue | 17 +- 8 files changed, 489 insertions(+), 33 deletions(-) create mode 100644 src/views/components/management/person/components/change-password-modal/index.vue create mode 100644 src/views/components/management/person/components/change-password-modal/style.scss create mode 100644 src/views/components/management/person/components/verification-code/index.vue diff --git a/src/api/all/index.ts b/src/api/all/index.ts index f1f4383..e4c8038 100644 --- a/src/api/all/index.ts +++ b/src/api/all/index.ts @@ -122,7 +122,7 @@ export const sendUpdateMobileCaptcha = (data: any) => { // 修改绑定的手机号 export const updateMobile = (data: any) => { - return Http.post(`/v1/me/mobile`, data); + return Http.patch(`/v1/me/mobile`, data); }; // 修改我的信息 diff --git a/src/api/all/login.ts b/src/api/all/login.ts index 0277606..09047ea 100644 --- a/src/api/all/login.ts +++ b/src/api/all/login.ts @@ -92,3 +92,19 @@ export const getMyPrimaryEnterprise = () => { export const postUpdateMobileCaptcha = (params = {}) => { return Http.post('/v1/sms/update-mobile-captcha', params); }; + +// 发送修改密码验证码 +export const postUpdatePasswordCaptcha = (params = {}) => { + return Http.post('/v1/sms/update-password-captcha', params); +}; + + +// 验证修改密码验证码 +export const postCheckUpdatePasswordCaptcha = (params = {}) => { + return Http.post('/v1/sms/check-update-password-captcha', params); +}; + +// 修改密码 +export const postUpdatePassword = (params = {}) => { + return Http.patch('/v1/me/password', params); +}; diff --git a/src/views/components/management/person/components/change-mobile-modal/index.vue b/src/views/components/management/person/components/change-mobile-modal/index.vue index 74d474a..7592b7f 100644 --- a/src/views/components/management/person/components/change-mobile-modal/index.vue +++ b/src/views/components/management/person/components/change-mobile-modal/index.vue @@ -39,13 +39,13 @@
- +
+ + 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 new file mode 100644 index 0000000..aa2630c --- /dev/null +++ b/src/views/components/management/person/components/change-password-modal/style.scss @@ -0,0 +1,60 @@ +.change-password-modal { + .ant-modal-content { + border-radius: 16px; + + .ant-modal-header { + border-radius: 16px 16px 0 0; + border-bottom: none !important; + + .ant-modal-title { + display: none; + } + } + + .ant-modal-body { + padding: 0 32px 8px !important; + position: relative; + top: -24px; + display: flex; + flex-direction: column; + justify-content: center; + + .cts { + color: var(--Text-3, #737478); + font-family: $font-family-regular; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: 22px; /* 157.143% */ + } + .title-text { + color: var(--Text-1, #211F24); + text-align: center; + font-family: $font-family-medium; + font-size: 24px; + font-style: normal; + font-weight: 500; + line-height: 32px; + } + + .ant-form { + .ant-form-item { + &:not(:last-child) { + margin-bottom: 24px !important; + } + + .ant-input-affix-wrapper { + border-radius: 8px !important; + } + } + } + + } + + .ant-modal-footer { + height: 56px !important; + border-top: none !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 new file mode 100644 index 0000000..f586963 --- /dev/null +++ b/src/views/components/management/person/components/verification-code/index.vue @@ -0,0 +1,154 @@ + + + + + diff --git a/src/views/components/management/person/index.vue b/src/views/components/management/person/index.vue index 0892b47..2914712 100644 --- a/src/views/components/management/person/index.vue +++ b/src/views/components/management/person/index.vue @@ -25,7 +25,7 @@ v-for="(item, index) in new Array(10).fill(0)" :key="index" > - + @@ -110,11 +110,7 @@ /> - + @@ -123,7 +119,7 @@ import { Avatar, Button, Form, FormItem, Input, message } from 'ant-design-vue'; import Modal from '@/components/modal.vue'; import PuzzleVerification from '@/views/login/components/PuzzleVerification.vue'; -import SafetyVerificationModal from './components/safety-verification-modal/index.vue'; +import ChangePasswordModal from './components/change-password-modal/index.vue'; import ChangeNameModal from './components/change-name-modal/index.vue'; import ChangeMobileModal from './components/change-mobile-modal/index.vue'; @@ -137,7 +133,7 @@ import { useUserStore } from '@/stores'; import icon1 from './img/icon1.png'; const store = useUserStore(); -const safetyVerificationModalRef = ref(null); +const changePasswordModalRef = ref(null); const changeNameModalRef = ref(null); const changeMobileModalRef = ref(null); @@ -175,8 +171,6 @@ const mobile = computed(() => { return _mobile.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2'); }); -console.log(store.userInfo); - // 表单校验规则 const formRules = { mobile: [ @@ -256,6 +250,9 @@ const openChangeNameModal = () => { const openChangeMobileModal = () => { changeMobileModalRef.value.open(); }; +const openChangePasswordModal = () => { + changePasswordModalRef.value.open(dataSource.value.mobile); +}; async function handleSubmitUserInfo() { await updateMyInfo(userInfoForm);