他人页修复id 不存在的问题
This commit is contained in:
@@ -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<Partial<UserInfoType>>({
|
||||
|
||||
Reference in New Issue
Block a user