我将仇恨写在冰上,然后期待太阳的升起。——加西亚马尔克斯
这里Opt
用的是之前博客提到的复制修改过的Optional
:
https://vampireachao.gitee.io/2021/07/19/新版Optional/
shaun
我之前也稍微写过:https://cloud.tencent.com/developer/article/2075311
代码很简单:
/**
* 获取用户信息
*
* @return com.baomidou.shaun.core.profile.TokenProfile
* @author <achao1441470436@gmail.com>
* @since 2021/9/9 10:33
*/
public static Opt<TokenProfile> getProfile() {
final JEEContext context = WebUtil.getJEEContext(false);
return Opt.ofNullable(CORE_CONFIG.getProfileTokenManager().getProfile(context));
}
参考的是shaun
源码中com.baomidou.shaun.core.filter
中的写法