feat: 事件详情页 URL ID 加密,防止用户遍历
- 新增 idEncoder.ts 工具:使用 Base64 + 前缀混淆加密 ID - 路由改为查询参数形式:/event-detail?id=xxx - 更新所有入口使用 getEventDetailUrl() 生成加密链接 - 兼容旧链接:纯数字 ID 仍可正常访问 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,7 @@ import { ChevronDownIcon } from '@chakra-ui/icons';
|
||||
import { FiCalendar } from 'react-icons/fi';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useFollowingEvents } from '../../../../hooks/useFollowingEvents';
|
||||
import { getEventDetailUrl } from '@/utils/idEncoder';
|
||||
|
||||
/**
|
||||
* 关注事件下拉菜单组件
|
||||
@@ -86,7 +87,7 @@ const FollowingEventsMenu = memo(() => {
|
||||
<MenuItem
|
||||
key={ev.id}
|
||||
_hover={{ bg: 'gray.50' }}
|
||||
onClick={() => navigate(`/event-detail/${ev.id}`)}
|
||||
onClick={() => navigate(getEventDetailUrl(ev.id))}
|
||||
>
|
||||
<HStack justify="space-between" w="100%">
|
||||
<Box flex={1} minW={0}>
|
||||
|
||||
Reference in New Issue
Block a user