Skip to content

Commit

Permalink
🐞 fix:修复登陆路由
Browse files Browse the repository at this point in the history
  • Loading branch information
eleliauk committed Aug 25, 2024
1 parent 0aba69e commit bd18214
Show file tree
Hide file tree
Showing 3 changed files with 438 additions and 532 deletions.
2 changes: 1 addition & 1 deletion src/common/api/handleLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const handleLogin = async (data: Record<string, unknown> = {}) => {
},
});

await Taro.navigateTo({
await Taro.switchTab({
url: '/pages/main/index',
});
}
Expand Down
10 changes: 9 additions & 1 deletion src/common/components/comment/comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ export default function Comment(props: CommentInfo & { type?: string }) {
useCourseStore.getState().getPublishers(publisher_id || 0);
});
}, [course_id, publisher_id]);
async function navigateToPage() {
await Taro.navigateTo({
url: '/pages/classInfo/index', // 确保路径正确
});
}

function handleClickToClass() {
navigateToPage().then((r) => console.log(r)); // 这里调用异步函数,但不返回 Promise
}
return (
<View className="bigcomment" onClick={handleClick}>
<View className="commentplus">
Expand All @@ -44,7 +52,7 @@ export default function Comment(props: CommentInfo & { type?: string }) {
</>
) : (
<>
<View className="classTitle">
<View className="classTitle" onClick={handleClickToClass}>
{courseDetail[course_id || 0]?.name +
' (' +
courseDetail[course_id || 0]?.teacher +
Expand Down
Loading

0 comments on commit bd18214

Please sign in to comment.