Commit 6dc44cb4 authored by youjie's avatar youjie

修改密码

parent 0660d84b
...@@ -244,6 +244,8 @@ export interface ResetPasswordDto { ...@@ -244,6 +244,8 @@ export interface ResetPasswordDto {
* 重置密码响应 * 重置密码响应
*/ */
export interface ResetPasswordResponseDto { export interface ResetPasswordResponseDto {
/** 错误码 */
code?: number
/** 是否成功 */ /** 是否成功 */
success: boolean success: boolean
/** 消息 */ /** 消息 */
...@@ -954,8 +956,11 @@ class UserService { ...@@ -954,8 +956,11 @@ class UserService {
} }
const response = await OtaRequest.post( const response = await OtaRequest.post(
'/member-auth/update-password', '/member-auth/update-password',
data, {},
{ {
params: {
...data
},
headers: tenantId ? { headers: tenantId ? {
'__tenant': tenantId '__tenant': tenantId
} : {} } : {}
......
...@@ -366,16 +366,16 @@ const handleSubmit = async () => { ...@@ -366,16 +366,16 @@ const handleSubmit = async () => {
loading.value = true loading.value = true
try { try {
const response = await UserService.resetPasswordAsync(formData.tenantId || 'default',formData.email,formData.code,formData.newPassword) const response = await UserService.resetPasswordAsync(formData.tenantId || 'default',formData.email,formData.code,formData.newPassword)
console.log(response,'response') if(response){
Message.success(t('login.resetSuccess')) Message.success(t('login.resetSuccess'))
// 延迟跳转到登录页 // 延迟跳转到登录页
setTimeout(() => {
if(params&&params.email){ if(params&&params.email){
router.push('/basicInfor') router.push('/basicInfor')
}else{ }else{
router.push('/login') router.push('/login')
} }
}, 2000) }
} catch (error: any) { } catch (error: any) {
Message.error(error.message || t('login.resetFailed')) Message.error(error.message || t('login.resetFailed'))
} finally { } finally {
......
...@@ -387,13 +387,12 @@ const handleSubmit = async () => { ...@@ -387,13 +387,12 @@ const handleSubmit = async () => {
loading.value = true loading.value = true
try { try {
const response = await UserService.resetPasswordAsync(formData.tenantId || 'default',formData.email,formData.code,formData.newPassword) const response = await UserService.resetPasswordAsync(formData.tenantId || 'default',formData.email,formData.code,formData.newPassword)
console.log(response,'response') if(response){
Message.success(t('login.resetSuccess')) Message.success(t('login.resetSuccess'))
// currentStep.value ++ // currentStep.value ++
// 延迟跳转 // 延迟跳转
setTimeout(() => {
router.push('/account') router.push('/account')
}, 2000) }
} catch (error: any) { } catch (error: any) {
Message.error(error.message || t('login.resetFailed')) Message.error(error.message || t('login.resetFailed'))
} finally { } finally {
......
...@@ -368,12 +368,11 @@ const handleSubmit = async () => { ...@@ -368,12 +368,11 @@ const handleSubmit = async () => {
loading.value = true loading.value = true
try { try {
const response = await UserService.setNewPasswordAsync(formData.tenantId || 'default',formData.oldPassword,formData.newPassword) const response = await UserService.setNewPasswordAsync(formData.tenantId || 'default',formData.oldPassword,formData.newPassword)
console.log(response,'response') if(response){
Message.success(t('login.resetSuccess')) Message.success(t('login.resetSuccess'))
// 延迟跳转到登录页 // 延迟跳转到登录页
setTimeout(() => {
goPage('/account') goPage('/account')
}, 2000) }
} catch (error: any) { } catch (error: any) {
Message.error(error.message || t('login.resetFailed')) Message.error(error.message || t('login.resetFailed'))
} finally { } 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