mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 12:17:24 +00:00
Encode usernames in API requests and navigation links to handle special characters.
This commit is contained in:
@@ -11,7 +11,10 @@ import { MdOutlineArrowRight } from "react-icons/md";
|
||||
export default function UserPage() {
|
||||
const [user, setUser] = useState<User | null>(null);
|
||||
|
||||
const { username } = useParams();
|
||||
const { username: rawUsername } = useParams();
|
||||
|
||||
// 解码用户名,确保特殊字符被还原
|
||||
const username = rawUsername ? decodeURIComponent(rawUsername) : "";
|
||||
|
||||
const [page, setPage] = useState(0);
|
||||
|
||||
|
Reference in New Issue
Block a user