使用若以框架的时候,项目报错:
class com.alibaba.fastjson2.JSONObject cannot be cast to class com.xuke.common.core.domain.model.LoginUser (com.alibaba.fastjson2.JSONObject and com.xuke.common.core.domain.model.LoginUser are in unnamed module of loader org.springframework.boot.devtools.
报错原因:修改了LoginUser的包路径。
若依框架内里redis使用了FastJson的序列化,在序列化的JSON字符串中带上了类型信息,因此在反序列化时,不必要传入类型,实现主动类型辨认。