@@ -13,8 +13,8 @@
< view class = "area-msg-list-content" v-for = "item in chatMsgList" :key="item.msgId" :id="item.msgId" >
< template v-if = "item.msgType === MessageRole.AI" >
< ChatCardAI class = "flex flex-justify-start" : key = "`ai-${item.msgId}-${item.msg ? item.msg.length : 0}`"
: text = "item.msg || ''" :isLoading = "item.isLoading" >
< ChatCardAI : key = "`ai-${item.msgId}-${item.msg ? item.msg.length : 0}`" : text = "item.msg || ''"
:isLoading = "item.isLoading" >
< template # content v-if = "item.toolCall" >
< QuickBookingComponent v-if = "item.toolCall.componentName === CompName.quickBookingCard" / >
< DiscoveryCardComponent v-else-if ="
@@ -99,7 +99,7 @@ import DetailCardCompontent from "../../module/DetailCardCompontent/index.vue";
import CreateServiceOrder from "@/components/CreateServiceOrder/index.vue";
import Feedback from "@/components/Feedback/index.vue";
import AddCarCrad from "@/components/AddCarCrad/index.vue";
import { mainPageData } from "@/request/api/MainPageDataApi";
import { mainPageData, contentSecurityDetection } from "@/request/api/MainPageDataApi";
import {
conversationMsgList,
recentConversation,
@@ -109,6 +109,7 @@ import { ThrottleUtils, IdUtils } from "@/utils";
import { checkToken } from "@/hooks/useGoLogin";
import { useAppStore } from "@/store";
import { getAccessToken } from "@/constant/token";
import { getCurrentConfig } from "@/constant/base";
const appStore = useAppStore();
/// 导航栏相关
@@ -242,9 +243,22 @@ const handleReplyInstruct = async (item) => {
};
// 输入区的发送消息事件
const sendMessageAction = (inputText) => {
const sendMessageAction = async (inputText) => {
console.log("输入消息:", inputText);
if (!inputText.trim()) return;
// contentSecurityDetection
// #ifdef MP-TOUTIAO
if (await contentSecurityDetectionApi(inputText)) {
uni.showToast({
title: "不能输入违法、违规内容",
icon: "none",
});
return false;
}
// #endif
handleNoHideKeyboard();
// 重置消息状态, 准备接收新的AI回复
@@ -261,6 +275,15 @@ const sendMessageAction = (inputText) => {
setTimeoutScrollToBottom();
};
// 抖音内容安全检测
const contentSecurityDetectionApi = async (inputText) => {
const { data } = await contentSecurityDetection({
clientId: getCurrentConfig().clientId,
detectionContent: inputText
})
return data;
}
/// 添加通知
const addNoticeListener = () => {
uni.$on(NOTICE_EVENT_LOGIN_SUCCESS, () => {