菜鸟的博客

纵有疾风起,人生不言弃。

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

统计

软件工程日报2

 

所花时间(包括上课):  0.5h
代码量(行):  50左右
搏客量(篇):  1
了解到的知识点:  获取用户详细信息
备注(其他):  
//在userController中,写好控制类
 @GetMapping("userInfo")
    public Result<Object> userInfo(@RequestHeader(name = "Authorization") String token){
        Map<String, Object> map = JwtUtil.parseToken(token);
        String username = (String)map.get("username");
        User user = userService.findByUserName(username);

        return Result.success(user);
    }



//同时为了防止password被以字符串的形式返回,需要在实体类user中,在password上添加@JsonIgnore
@JsonIgnore
    private String password;//密码
#在application.yml中
mybatis:
  configuration:
    map-underscore-to-camel-case: true #开启下划线驼峰命名之间的转换

posted on   hhmzd233  阅读(9)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· NetPad:一个.NET开源、跨平台的C#编辑器
· 面试官:你是如何进行SQL调优的?
点击右上角即可分享
微信分享提示