feat: 关键词过滤
This commit is contained in:
@@ -8,7 +8,9 @@
|
|||||||
:style="{ height: navBarHeight + 'px' }">
|
:style="{ height: navBarHeight + 'px' }">
|
||||||
<!-- 左侧返回按钮 -->
|
<!-- 左侧返回按钮 -->
|
||||||
<view class="nav-bar-left flex flex-items-center flex-justify-center" v-if="showBack" @click="handleBack">
|
<view class="nav-bar-left flex flex-items-center flex-justify-center" v-if="showBack" @click="handleBack">
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<uni-icons type="left" size="20" :color="backIconColor" />
|
<uni-icons type="left" size="20" :color="backIconColor" />
|
||||||
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 中间标题区域 -->
|
<!-- 中间标题区域 -->
|
||||||
|
|||||||
@@ -78,6 +78,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
"navigationStyle": "custom",
|
||||||
"navigationBarTextstyle": "black",
|
"navigationBarTextstyle": "black",
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"navigationBarBackgroundcolor": "#F8F8F8",
|
"navigationBarBackgroundcolor": "#F8F8F8",
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
|
|
||||||
<view class="area-msg-list-content" v-for="item in chatMsgList" :key="item.msgId" :id="item.msgId">
|
<view class="area-msg-list-content" v-for="item in chatMsgList" :key="item.msgId" :id="item.msgId">
|
||||||
<template v-if="item.msgType === MessageRole.AI">
|
<template v-if="item.msgType === MessageRole.AI">
|
||||||
<ChatCardAI class="flex flex-justify-start" :key="`ai-${item.msgId}-${item.msg ? item.msg.length : 0}`"
|
<ChatCardAI :key="`ai-${item.msgId}-${item.msg ? item.msg.length : 0}`" :text="item.msg || ''"
|
||||||
:text="item.msg || ''" :isLoading="item.isLoading">
|
:isLoading="item.isLoading">
|
||||||
<template #content v-if="item.toolCall">
|
<template #content v-if="item.toolCall">
|
||||||
<QuickBookingComponent v-if="item.toolCall.componentName === CompName.quickBookingCard" />
|
<QuickBookingComponent v-if="item.toolCall.componentName === CompName.quickBookingCard" />
|
||||||
<DiscoveryCardComponent v-else-if="
|
<DiscoveryCardComponent v-else-if="
|
||||||
@@ -99,7 +99,7 @@ import DetailCardCompontent from "../../module/DetailCardCompontent/index.vue";
|
|||||||
import CreateServiceOrder from "@/components/CreateServiceOrder/index.vue";
|
import CreateServiceOrder from "@/components/CreateServiceOrder/index.vue";
|
||||||
import Feedback from "@/components/Feedback/index.vue";
|
import Feedback from "@/components/Feedback/index.vue";
|
||||||
import AddCarCrad from "@/components/AddCarCrad/index.vue";
|
import AddCarCrad from "@/components/AddCarCrad/index.vue";
|
||||||
import { mainPageData } from "@/request/api/MainPageDataApi";
|
import { mainPageData, contentSecurityDetection } from "@/request/api/MainPageDataApi";
|
||||||
import {
|
import {
|
||||||
conversationMsgList,
|
conversationMsgList,
|
||||||
recentConversation,
|
recentConversation,
|
||||||
@@ -109,6 +109,7 @@ import { ThrottleUtils, IdUtils } from "@/utils";
|
|||||||
import { checkToken } from "@/hooks/useGoLogin";
|
import { checkToken } from "@/hooks/useGoLogin";
|
||||||
import { useAppStore } from "@/store";
|
import { useAppStore } from "@/store";
|
||||||
import { getAccessToken } from "@/constant/token";
|
import { getAccessToken } from "@/constant/token";
|
||||||
|
import { getCurrentConfig } from "@/constant/base";
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
/// 导航栏相关
|
/// 导航栏相关
|
||||||
@@ -242,9 +243,22 @@ const handleReplyInstruct = async (item) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 输入区的发送消息事件
|
// 输入区的发送消息事件
|
||||||
const sendMessageAction = (inputText) => {
|
const sendMessageAction = async (inputText) => {
|
||||||
console.log("输入消息:", inputText);
|
console.log("输入消息:", inputText);
|
||||||
if (!inputText.trim()) return;
|
if (!inputText.trim()) return;
|
||||||
|
|
||||||
|
// contentSecurityDetection
|
||||||
|
|
||||||
|
// #ifdef MP-TOUTIAO
|
||||||
|
if (await contentSecurityDetectionApi(inputText)) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "不能输入违法、违规内容",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
handleNoHideKeyboard();
|
handleNoHideKeyboard();
|
||||||
|
|
||||||
// 重置消息状态,准备接收新的AI回复
|
// 重置消息状态,准备接收新的AI回复
|
||||||
@@ -261,6 +275,15 @@ const sendMessageAction = (inputText) => {
|
|||||||
setTimeoutScrollToBottom();
|
setTimeoutScrollToBottom();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 抖音内容安全检测
|
||||||
|
const contentSecurityDetectionApi = async (inputText) => {
|
||||||
|
const { data } = await contentSecurityDetection({
|
||||||
|
clientId: getCurrentConfig().clientId,
|
||||||
|
detectionContent: inputText
|
||||||
|
})
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
/// 添加通知
|
/// 添加通知
|
||||||
const addNoticeListener = () => {
|
const addNoticeListener = () => {
|
||||||
uni.$on(NOTICE_EVENT_LOGIN_SUCCESS, () => {
|
uni.$on(NOTICE_EVENT_LOGIN_SUCCESS, () => {
|
||||||
|
|||||||
@@ -16,4 +16,9 @@ function discoveryCradComponent() {
|
|||||||
return request.get("/hotelBiz/mainScene/discoveryComponent", {});
|
return request.get("/hotelBiz/mainScene/discoveryComponent", {});
|
||||||
}
|
}
|
||||||
|
|
||||||
export { mainPageData, quickBookingComponent, discoveryCradComponent };
|
// 抖音内容安全检测
|
||||||
|
function contentSecurityDetection(args) {
|
||||||
|
return request.post("/hotelBiz/douyin/contentSecurityDetection", args);
|
||||||
|
}
|
||||||
|
|
||||||
|
export { mainPageData, quickBookingComponent, discoveryCradComponent, contentSecurityDetection };
|
||||||
|
|||||||
Reference in New Issue
Block a user