diff --git a/src/layouts/Header.vue b/src/layouts/Header.vue
index 7794813..f683b61 100644
--- a/src/layouts/Header.vue
+++ b/src/layouts/Header.vue
@@ -61,7 +61,7 @@
@@ -85,7 +85,7 @@
@@ -108,15 +108,57 @@
+
+
+
+
+
+
+
+
+
+
+ 社区
+
+
+
+ 社区主页
+
+
+ 助理预设
+
+
+
+ 工具分享
+
+
+ 助理提示词
+
+
+
+
-
+
@@ -163,6 +205,7 @@ import {
PersonOutline,
AddOutline,
BugOutline,
+ PeopleCircleOutline,
// TrashOutline,
} from "@vicons/ionicons5";
import router from "@/router";
@@ -171,7 +214,7 @@ import router from "@/router";
import leaflowpng from "@/assets/images/leaflow.png";
import { useChatStore } from "@/stores/chat";
import groupPng from "@/assets/images/group.png";
-
+import config from "@/config/config";
const userStore = useUserStore();
const chatStore = useChatStore();
@@ -194,7 +237,15 @@ if (isMobile.value) {
// await getApi().ChatMessage.apiV1ChatsIdClearPost(chatStore.currentChatId);
// };
-const backToHome = () => {
+const toggleHomeChat = () => {
+ if (router.currentRoute.value.name == "/home/") {
+ router.push("/");
+ } else {
+ router.push("/home");
+ }
+};
+
+const newChat = () => {
router.push("/");
};
diff --git a/src/pages/Guest.vue b/src/pages/Guest.vue
index 801a3fd..47f92fb 100644
--- a/src/pages/Guest.vue
+++ b/src/pages/Guest.vue
@@ -37,6 +37,15 @@
+
+ 👋 一起加入
+
+ 我们提供了 WP Amber,此 WordPress 插件可以将 Amber
+ 放到你的博客中,让您的访客通过助理来总结并解释文章等。
+
+
+
+
💬 对话优化引擎
@@ -126,15 +135,6 @@
不会长期保存您的文档的源文件,我们不建议您上传具有机密性的文档。
-
-
- 👋 一起加入
-
- 我们提供了 WP Amber,此 WordPress 插件可以将 Amber
- 放到你的博客中,让您的访客通过助理来总结并解释文章等。
-
-
-
diff --git a/src/pages/home/index.vue b/src/pages/home/index.vue
new file mode 100644
index 0000000..6158a33
--- /dev/null
+++ b/src/pages/home/index.vue
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/src/plugins/menus/user.ts b/src/plugins/menus/user.ts
index 9e4395d..3de5234 100644
--- a/src/plugins/menus/user.ts
+++ b/src/plugins/menus/user.ts
@@ -1,7 +1,8 @@
import type { MenuOption } from "naive-ui";
import { RouterLink } from "vue-router";
import { NIcon } from "naive-ui";
-import { LogOutOutline } from "@vicons/ionicons5";
+import { ChatbubbleOutline, HammerOutline, HomeOutline, LogOutOutline, PeopleCircleOutline, PersonOutline } from "@vicons/ionicons5";
+import config from "@/config/config";
const menuOptions: Ref = ref([]);
@@ -10,6 +11,25 @@ function renderIcon(icon: Component) {
}
const addMenuItem = (to: string, label: string, icon: any) => {
+ // 如果 to 是 http 或 https 开头
+ if (/^(http|https):\/\//.test(to)) {
+ menuOptions.value.push({
+ label: () =>
+ h(
+ "a",
+ {
+ href: to,
+ target: "_blank",
+ rel: "noopener noreferrer",
+ },
+ { default: () => label }
+ ),
+ key: to,
+ icon: renderIcon(icon),
+ });
+ return;
+ }
+
menuOptions.value.push({
label: () =>
h(
@@ -26,6 +46,11 @@ const addMenuItem = (to: string, label: string, icon: any) => {
});
};
+addMenuItem("/home/", "Amber 首页", HomeOutline);
+addMenuItem(config.forum_url, "社区主页", PeopleCircleOutline);
+addMenuItem(config.forum_url + "/t/assistant", "助理预设", PersonOutline);
+addMenuItem(config.forum_url + "/t/tools", "工具分享", HammerOutline);
+addMenuItem(config.forum_url + "/t/prompts", "助理提示词", ChatbubbleOutline);
addMenuItem("/auth/logout", "退出登录", LogOutOutline);
export { addMenuItem as addUserMenu, menuOptions as userMenuOptions };
diff --git a/src/typed-router.d.ts b/src/typed-router.d.ts
index b9a07b0..c8cb22e 100644
--- a/src/typed-router.d.ts
+++ b/src/typed-router.d.ts
@@ -30,5 +30,6 @@ declare module 'vue-router/auto-routes' {
'/errors/500': RouteRecordInfo<'/errors/500', '/errors/500', Record, Record>,
'/errors/Base': RouteRecordInfo<'/errors/Base', '/errors/Base', Record, Record>,
'/Guest': RouteRecordInfo<'/Guest', '/Guest', Record, Record>,
+ '/home/': RouteRecordInfo<'/home/', '/home', Record, Record>,
}
}