From e486b6e4c4a6f32f3b943ed866309c65bf3d5996 Mon Sep 17 00:00:00 2001 From: P-Jhao <113034340+P-Jhao@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:34:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=9C=A8=E6=9C=80=E6=9C=AB=E5=B0=BE=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/userService.js | 7 +++++-- utils/tools.js | 8 ++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/services/userService.js b/services/userService.js index 5cd5f52..71e310c 100644 --- a/services/userService.js +++ b/services/userService.js @@ -32,10 +32,13 @@ module.exports.loginService = async function (loginInfo) { } module.exports.updateUserInfoService = async function (userInfo) { + + // userInfo.loginPwd = md5(userInfo.loginPwd) await updateUserDao(userInfo) - const data = await getUserInfoDao(userInfo.loginId) - return data.dataValues + const result = await getUserInfoDao(userInfo.loginId) + + return result.dataValues } module.exports.getUserInfoService = async function (loginId) { diff --git a/utils/tools.js b/utils/tools.js index 68d310e..cdee465 100644 --- a/utils/tools.js +++ b/utils/tools.js @@ -26,8 +26,12 @@ module.exports.getRandomExpressId = function () { module.exports.handleArrayDaoData = function (arr) { const result = [] - for (const item of arr) { - result.push(item.dataValues) + // for (const item of arr) { + // result.push(item.dataValues) + // } + //倒叙输出 + for (let i = arr.length - 1; i >= 0; i--) { + result.push(arr[i].dataValues) } return result } \ No newline at end of file