fix userhome bug

This commit is contained in:
Himit_ZH 2021-12-27 10:39:50 +08:00
parent 48f5556d1c
commit 9380151d1c
2 changed files with 9 additions and 9 deletions

View File

@ -405,13 +405,13 @@ public class AccountController {
HttpServletRequest request) {
HttpSession session = request.getSession();
UserRolesVo userRolesVo = (UserRolesVo) session.getAttribute("userInfo");
// 如果没有uid默认查询当前登录用户的
if (uid == null && userRolesVo != null) {
uid = userRolesVo.getUid();
}
// 如果没有uid和username默认查询当前登录用户的
if (StringUtils.isEmpty(uid) && StringUtils.isEmpty(username)) {
return CommonResult.errorResponse("请求参数错误uid和username不能都为空");
if (userRolesVo != null){
uid = userRolesVo.getUid();
}else {
return CommonResult.errorResponse("查询参数错误uid和username不能都为空");
}
}
UserHomeVo userHomeInfo = userRecordDao.getUserHomeInfo(uid, username);

View File

@ -75,9 +75,9 @@
<if test="uid!=null">
AND u.uuid = #{uid}
</if>
<if test="username!=null">
AND u.username = #{username}
</if>
<if test="username!=null">
AND u.username = #{username}
</if>
</where>
</select>