diff --git a/.env.development b/.env.development index 5a4c728..007e426 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,8 @@ VITE_OUTPUT_DIR = 'dev' VITE_PUBLIC_PATH = / #新数据接口 -VITE_APP_API_BASE_URL = "http://39.101.133.168:8828/link" +# VITE_APP_API_BASE_URL = "http://39.101.133.168:8828/link" +VITE_APP_API_BASE_URL = "https://api.homilychart.com/link" VITE_APP_IMG_API_BASE_URL = "http://39.101.133.168:8828/hljw/api/aws/upload" #MJ API diff --git a/src/api/AIxiaocaishen.js b/src/api/AIxiaocaishen.js index 71d599c..b3394ad 100644 --- a/src/api/AIxiaocaishen.js +++ b/src/api/AIxiaocaishen.js @@ -141,7 +141,7 @@ export const getReplyAPI = function (params) { headers: { "Content-Type": "application/json", Authorization: - "Bearer pat_DLMr7u1d6pmgC2demIYksrOm0r2k2w9XDxKmHvBvOQ5Lw5AYrByJ2IZpdwoJPYGi", + "Bearer pat_lK1fvhLn9LnWCRETP7yFeR6xQ0niwQdcHJ5ZqpnUk8BdiUWCraPLSzWhiQNp2zOl", }, }); }; @@ -156,7 +156,7 @@ export const getReplyStreamAPI = function (params) { headers: { "Content-Type": "application/json", Authorization: - "Bearer pat_DLMr7u1d6pmgC2demIYksrOm0r2k2w9XDxKmHvBvOQ5Lw5AYrByJ2IZpdwoJPYGi", + "Bearer pat_lK1fvhLn9LnWCRETP7yFeR6xQ0niwQdcHJ5ZqpnUk8BdiUWCraPLSzWhiQNp2zOl", }, }); }; @@ -171,7 +171,7 @@ export const TTSAPI = function (params) { }), headers: { Authorization: - "Bearer pat_DLMr7u1d6pmgC2demIYksrOm0r2k2w9XDxKmHvBvOQ5Lw5AYrByJ2IZpdwoJPYGi", + "Bearer pat_lK1fvhLn9LnWCRETP7yFeR6xQ0niwQdcHJ5ZqpnUk8BdiUWCraPLSzWhiQNp2zOl", "Content-Type": "application/json", }, }); diff --git a/src/api/AiEmotionApi.js b/src/api/AiEmotionApi.js new file mode 100644 index 0000000..15c0244 --- /dev/null +++ b/src/api/AiEmotionApi.js @@ -0,0 +1,76 @@ +import request from "../utils/request"; + +const APIurl = import.meta.env.VITE_APP_API_BASE_URL; +const MJAPIurl = import.meta.env.VITE_APP_MJ_API_BASE_URL; + +//数据接口 +export const dataListAPI = function (params) { + // URLSearchParams只接受全部字符串的数据 + // 将传入数据转化成字符串 + const StringParams = new URLSearchParams( + Object.entries(params).map(([key, value]) => [key, String(value)]) + ); + return request({ + url: `${APIurl}/api/brain/data`, + method: "post", + data: StringParams, + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + }); +}; + +// 获取回复接口 +export const getReplyAPI = function (params) { + return fetch("https://api.coze.cn/v1/workflow/run", { + method: "POST", + body: JSON.stringify({ + workflow_id: "7509384582975897650", + parameters: params, + }), + headers: { + "Content-Type": "application/json", + Authorization: + "Bearer pat_lK1fvhLn9LnWCRETP7yFeR6xQ0niwQdcHJ5ZqpnUk8BdiUWCraPLSzWhiQNp2zOl", + }, + }); +}; +// 获取回复接口流式 +export const getReplyStreamAPI = function (params) { + return fetch(`https://api.coze.cn/v1/workflow/stream_run`, { + method: "POST", + body: JSON.stringify({ + workflow_id: "7481159261435854860", + parameters: params, + }), + headers: { + "Content-Type": "application/json", + Authorization: + "Bearer pat_lK1fvhLn9LnWCRETP7yFeR6xQ0niwQdcHJ5ZqpnUk8BdiUWCraPLSzWhiQNp2zOl", + }, + }); +}; + + +// 反馈前台-用户提交反馈接口 +export const addFeedbackAPI = function (params) { + return request({ + url: `${APIurl}/api/ai_god/feedback/add`, + method: "POST", + data: new URLSearchParams(params), + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + }); +}; +// 反馈前台-查询该用户提交的全部反馈内容 +export const getFeedbackAPI = function (params) { + return request({ + url: `${APIurl}/api/ai_god/feedback/select`, + method: "POST", + data: new URLSearchParams(params), + headers: { + "Content-Type": "application/x-www-form-urlencoded", + }, + }); +}; diff --git a/src/assets/img/AiEmotion/round01.jpg b/src/assets/img/AiEmotion/round01.jpg new file mode 100644 index 0000000..cc7ac67 Binary files /dev/null and b/src/assets/img/AiEmotion/round01.jpg differ diff --git a/src/assets/img/AiEmotion/round02.jpg b/src/assets/img/AiEmotion/round02.jpg new file mode 100644 index 0000000..105ee80 Binary files /dev/null and b/src/assets/img/AiEmotion/round02.jpg differ diff --git a/src/assets/img/homePage/AI情绪大模型小图标.png b/src/assets/img/homePage/AI情绪大模型小图标.png new file mode 100644 index 0000000..b2f9b62 Binary files /dev/null and b/src/assets/img/homePage/AI情绪大模型小图标.png differ diff --git a/src/assets/img/homePage/bk01.jpg b/src/assets/img/homePage/bk01.jpg new file mode 100644 index 0000000..9e80d6d Binary files /dev/null and b/src/assets/img/homePage/bk01.jpg differ diff --git a/src/assets/img/homePage/夺宝奇兵大模型小图标.png b/src/assets/img/homePage/夺宝奇兵大模型小图标.png new file mode 100644 index 0000000..1001c5c Binary files /dev/null and b/src/assets/img/homePage/夺宝奇兵大模型小图标.png differ diff --git a/src/router/index.js b/src/router/index.js index f1e7a8d..38fc51a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -37,6 +37,11 @@ const routes = [ component: () => import('@/views/Feedback.vue'), }, { + path: '/AiEmotion', + name: 'AiEmotion', + component: () => import('@/views/AiEmotion.vue')//AI情绪大模型页面 + }, + { path: '/DBQBmodel', name: 'DBQBmodel', component: () => import('@/views/DBQBmodel.vue'), @@ -46,6 +51,7 @@ const routes = [ name: 'Emotionsmodel', component: () => import('@/views/Emotionsmodel.vue'), } + ] // 创建路由实例 const router = createRouter({ diff --git a/src/views/AiEmotion.vue b/src/views/AiEmotion.vue new file mode 100644 index 0000000..104e968 --- /dev/null +++ b/src/views/AiEmotion.vue @@ -0,0 +1,225 @@ + + + + + diff --git a/src/views/homePage.vue b/src/views/homePage.vue index dac8da9..00ff693 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -25,7 +25,7 @@ import voiceNoActive from "../assets/img/homePage/tail/voice-no-active.png"; import sendBtn from "../assets/img/homePage/tail/send.png"; import msgBtn from "../assets/img/homePage/tail/msg.png"; import feedbackBtn from "../assets/img/Feedback/feedbackBtn.png"; - +import AiEmotion from "./AiEmotion.vue"; // import VConsole from 'vconsole'; @@ -51,12 +51,16 @@ const activeIndex = ref( const tabs = computed(() => [ { name: "AIchat", - label: "AI对话", + label: "夺宝奇兵大模型", }, { name: "AIfind", label: "发现", }, + { + name: "AiEmotion", + label: "AI情绪大模型" + } ]); // 修改 setActiveTab 方法,添加一个可选参数 forceAIchat @@ -84,7 +88,13 @@ const activeComponent = computed(() => { if (isAnnouncementVisible.value) { return Announcement; } - return activeTab.value === "AIchat" ? AIchat : AIfind; + if (activeTab.value === "AIchat") { + return AIchat; + } else if (activeTab.value === "AIfind") { + return AIfind; + } else if (activeTab.value === "AiEmotion") { + return AiEmotion; // 新增逻辑 + } }); // 新增一个方法,调用时先判断是否处于 AIchat,若不在则跳转到 AIchat @@ -486,7 +496,6 @@ onMounted(async () => { -
@@ -508,9 +517,19 @@ onMounted(async () => { - - - - - - + + + + + +
@@ -671,7 +690,7 @@ body { /* height: var(--app-height, 100vh); */ height: var(--app-height, 100vh); margin: 0 auto; - background-image: url(/src/assets/img/homePage/bk.png); + background-image: url(/src/assets/img/homePage/bk01.jpg); background-size: 100% 100%; background-repeat: no-repeat; background-position: center; @@ -872,6 +891,7 @@ body { transform: scale(1.05); } + .send-btn { margin-left: auto; margin-right: 5px; @@ -938,8 +958,7 @@ body { } } -.ruleContent{ +.ruleContent { text-align: center; } -