diff --git a/src/api/v2/user/password.api.ts b/src/api/v2/user/password.api.ts index 6f3bcdd..177f375 100644 --- a/src/api/v2/user/password.api.ts +++ b/src/api/v2/user/password.api.ts @@ -4,9 +4,9 @@ import { post } from '@/utils/request' const password = async ( username: string, - old_password: string | null, + old_password: string | undefined, new_password: string, - verify_code: string | null + verify_code: string | undefined ) => { const rs = await post(`${base.api_v2_url}/user/password`, { username: username, diff --git a/src/components/UserInfo.vue b/src/components/UserInfo.vue index 6f9e472..ed7c392 100644 --- a/src/components/UserInfo.vue +++ b/src/components/UserInfo.vue @@ -312,7 +312,7 @@ async function changePassword() { } let rs try { - rs = await api.v2.user.password(data.username, data.oldPassword, data.newPassword, null) + rs = await api.v2.user.password(data.username, data.oldPassword, data.newPassword, undefined) } catch (e) { logger.error(e) tPassword.value.isLoading = false diff --git a/src/views/auth/ResetPasswordView.vue b/src/views/auth/ResetPasswordView.vue index b97de02..ea33640 100644 --- a/src/views/auth/ResetPasswordView.vue +++ b/src/views/auth/ResetPasswordView.vue @@ -153,7 +153,7 @@ async function doResetRequest() { try { rs = await api.v2.user.password( model.value.username, - null, + undefined, model.value.password, model.value.verifyCode )