Commit 6dc44cb4 authored by youjie's avatar youjie

修改密码

parent 0660d84b
......@@ -244,6 +244,8 @@ export interface ResetPasswordDto {
* 重置密码响应
*/
export interface ResetPasswordResponseDto {
/** 错误码 */
code?: number
/** 是否成功 */
success: boolean
/** 消息 */
......@@ -954,8 +956,11 @@ class UserService {
}
const response = await OtaRequest.post(
'/member-auth/update-password',
data,
{},
{
params: {
...data
},
headers: tenantId ? {
'__tenant': tenantId
} : {}
......
......@@ -366,16 +366,16 @@ const handleSubmit = async () => {
loading.value = true
try {
const response = await UserService.resetPasswordAsync(formData.tenantId || 'default',formData.email,formData.code,formData.newPassword)
console.log(response,'response')
Message.success(t('login.resetSuccess'))
// 延迟跳转到登录页
setTimeout(() => {
if(params&&params.email){
router.push('/basicInfor')
}else{
router.push('/login')
}
}, 2000)
if(response){
Message.success(t('login.resetSuccess'))
// 延迟跳转到登录页
if(params&&params.email){
router.push('/basicInfor')
}else{
router.push('/login')
}
}
} catch (error: any) {
Message.error(error.message || t('login.resetFailed'))
} finally {
......
......@@ -387,13 +387,12 @@ const handleSubmit = async () => {
loading.value = true
try {
const response = await UserService.resetPasswordAsync(formData.tenantId || 'default',formData.email,formData.code,formData.newPassword)
console.log(response,'response')
Message.success(t('login.resetSuccess'))
// currentStep.value ++
// 延迟跳转
setTimeout(() => {
if(response){
Message.success(t('login.resetSuccess'))
// currentStep.value ++
// 延迟跳转
router.push('/account')
}, 2000)
}
} catch (error: any) {
Message.error(error.message || t('login.resetFailed'))
} finally {
......
......@@ -368,12 +368,11 @@ const handleSubmit = async () => {
loading.value = true
try {
const response = await UserService.setNewPasswordAsync(formData.tenantId || 'default',formData.oldPassword,formData.newPassword)
console.log(response,'response')
Message.success(t('login.resetSuccess'))
// 延迟跳转到登录页
setTimeout(() => {
if(response){
Message.success(t('login.resetSuccess'))
// 延迟跳转到登录页
goPage('/account')
}, 2000)
}
} catch (error: any) {
Message.error(error.message || t('login.resetFailed'))
} finally {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment