fix: 修复blogs接口在手动删除redis数据库后抛出异常错误500问题 #158
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
问题复现方法
手动删除Redis数据库后访问/blogs接口 报错{"code":500,"msg":"异常错误","data":null}
问题说明
原有代码在缓存中保存了 PageResult,但读取出来后 BlogInfo 的结构不一致,导致序列化异常。
修复方式
调整了缓存的序列化处理逻辑,确保缓存读取后格式正确。