File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -112,11 +112,11 @@ const rules = ref<FormRules<CheckCodeRequest>>({
112112const loading = ref <boolean >(false )
113113const isDisabled = ref <boolean >(false )
114114const time = ref <number >(60 )
115-
115+ const sendLoading = ref < boolean >( false )
116116const checkCode = () => {
117117 resetPasswordFormRef .value
118118 ?.validate ()
119- .then (() => UserApi .checkCode (CheckEmailForm .value , loading ))
119+ .then (() => UserApi .checkCode (CheckEmailForm .value , sendLoading ))
120120 .then (() => router .push ({ name: ' reset_password' , params: CheckEmailForm .value }))
121121}
122122/**
@@ -125,7 +125,7 @@ const checkCode = () => {
125125const sendEmail = () => {
126126 resetPasswordFormRef .value ?.validateField (' email' , (v : boolean ) => {
127127 if (v ) {
128- UserApi .sendEmit (CheckEmailForm .value .email , ' reset_password' , loading ).then (() => {
128+ UserApi .sendEmit (CheckEmailForm .value .email , ' reset_password' , sendLoading ).then (() => {
129129 MsgSuccess (t (' views.login.verificationCode.successMessage' ))
130130 isDisabled .value = true
131131 handleTimeChange ()
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ import type { FormInstance, FormRules } from 'element-plus'
6666import UserApi from ' @/api/user'
6767import { t } from ' @/locales'
6868import useStore from ' @/stores'
69+
6970const { user } = useStore ()
7071const router = useRouter ()
7172const route = useRoute ()
@@ -133,10 +134,11 @@ const rules = ref<FormRules<ResetPasswordRequest>>({
133134})
134135const resetPasswordFormRef = ref <FormInstance >()
135136const loading = ref <boolean >(false )
137+ const sendLoading = ref <boolean >(false )
136138const resetPassword = () => {
137139 resetPasswordFormRef .value
138140 ?.validate ()
139- .then (() => UserApi .resetPassword (resetPasswordForm .value , loading ))
141+ .then (() => UserApi .resetPassword (resetPasswordForm .value , sendLoading ))
140142 .then (() => {
141143 MsgSuccess (t (' common.modifySuccess' ))
142144 router .push ({ name: ' login' })
You can’t perform that action at this time.
0 commit comments