diff --git a/src/user_pages/other/index.tsx b/src/user_pages/other/index.tsx index aae0f21..114a636 100644 --- a/src/user_pages/other/index.tsx +++ b/src/user_pages/other/index.tsx @@ -19,6 +19,14 @@ const OtherUserPage: React.FC = () => { // 获取页面参数 const instance = Taro.getCurrentInstance(); const user_id = instance.router?.params?.userid; + if(!user_id) { + Taro.showToast({ + title: "用户不存在", + icon: "none", + duration: 2000, + }); + Taro.navigateBack(); + } // 模拟用户数据 const [user_info, setUserInfo] = useState>({