Reiskuchen 5 роки тому
батько
коміт
bfda85fbf6

+ 7 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -95,7 +95,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     @Override
     public HttpRespMsg getUserInfo(String id) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
-        httpRespMsg.data = userMapper.selectById(id);
+        User user = userMapper.selectById(id);
+        if (user == null) {
+            httpRespMsg.setError("未查询到用户信息");
+        } else {
+            httpRespMsg.data = user;
+        }
+
         return httpRespMsg;
     }