From ed68e274e2f93f7cb5c70697e0c6c2e76a3a2982 Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Tue, 5 Sep 2023 16:59:24 +0800 Subject: [PATCH] fix --- fs_template/reset_confirm.tpl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fs_template/reset_confirm.tpl b/fs_template/reset_confirm.tpl index ceb896ce..a62e5eaa 100644 --- a/fs_template/reset_confirm.tpl +++ b/fs_template/reset_confirm.tpl @@ -145,14 +145,15 @@ function resetPassword() { }, body: JSON.stringify(data) }) - .then(response => { + .then(response => response.json()) + .then(data => { - if (response.ok ) { - console.log(response); - document.getElementById('successMessage').innerText = JSON.stringify(response); + if (data.code == 200 ) { + + document.getElementById('successMessage').innerText = JSON.stringify(data); } else { console.error('Password reset failed'); - document.getElementById('errorMessage').innerText = 'Password reset failed. Please try again.'; + document.getElementById('errorMessage').innerText = JSON.stringify(data); } })