diff --git a/src/components/Navbar.svelte b/src/components/Navbar.svelte
index 7daaf0a..7f63e83 100644
--- a/src/components/Navbar.svelte
+++ b/src/components/Navbar.svelte
@@ -81,7 +81,7 @@
>{$username}
-
Profile
+ Profile
Mychannels
Logout
diff --git a/src/router.js b/src/router.js
index 55eb40f..e24ca71 100644
--- a/src/router.js
+++ b/src/router.js
@@ -1,5 +1,6 @@
import Login from "./routes/login.svelte";
import MainPage from "./routes/mainpage.svelte";
+import MainPage1 from "./routes/mainpage1.svelte";
import DoorPage from "./routes/doorPage.svelte";
import Register from "./routes/register.svelte";
import CreateChannel from "./routes/createChannel.svelte";
@@ -20,6 +21,7 @@ export default {
"/": DoorPage,
"/login": Login,
"/main": MainPage,
+ "/main1": MainPage1,
"/register": Register,
"/createChannel": CreateChannel,
"/checkInformation": CheckInformation,
diff --git a/src/routes/mainpage1.svelte b/src/routes/mainpage1.svelte
new file mode 100644
index 0000000..729ee73
--- /dev/null
+++ b/src/routes/mainpage1.svelte
@@ -0,0 +1,189 @@
+
+
+
+
+
+
+
+
+
{$username}
+
+
+
+
+
+
+
+
Channels
+
+ {#each channels.slice(0, 6) as channel}
+
+
+ {/each}
+
+
+
+
+
+
+
Todos
+
+ {#each todos.slice(0, 2) as todo}
+
+
+ {/each}
+
+
+
+
+
+
diff --git a/src/routes/searchChannel.svelte b/src/routes/searchChannel.svelte
index 263b2c6..0bcf3d5 100644
--- a/src/routes/searchChannel.svelte
+++ b/src/routes/searchChannel.svelte
@@ -75,11 +75,32 @@
async function joinChannel(channelname, channelid) {
try {
const userEmail = $currentUserEmail;
+ // 获取当前日期
+ const now = new Date();
+ const year = now.getFullYear();
+ const month = now.getMonth() + 1; // JavaScript的月份是从0开始的
+ const day = now.getDate();
+
+ // 以备选方式获取频道描述
+ const records = await pb
+ .collection("channels")
+ .getFullList({ filter: `channelName="${channelname}"` });
+ if (records.length === 0) {
+ throw new Error("未找到指定的频道。");
+ }
+ const channelDescription = records[0].channelDescription;
+
+ // 创建记录并包含年月日和频道描述
await pb.collection("users_channels").create({
useremail: userEmail,
channelname: channelname,
originid: channelid,
+ year: year,
+ month: month,
+ day: day,
+ channelDescription: channelDescription, // 存储频道描述
});
+
alert("已成功加入频道");
navigateToChannelDetail("main");
} catch (error) {