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