更多--修改--新增点赞信息添加未登录验证

This commit is contained in:
haotian 2025-02-11 15:52:56 +08:00
parent 870b096a25
commit f21bbdae42

View File

@ -1675,7 +1675,15 @@ public class AppSystemController extends BaseController {
@Transactional
public AjaxResult addLike(@PathVariable("workId") Long workId)
{
Long userId = getUserId();
// 避免未登录点赞
Long userId = null;
try{
userId = getUserId();
}
catch (Exception e){
return error("请先登录");
}
// 不支持重复点赞
// 新增点赞记录