diff --git a/src/utils/request.ts b/src/utils/request.ts index 008b4aa..3c9c6ba 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -40,7 +40,7 @@ const $Decrypt = (text) => { // 尝试解析为JSON对象 return JSON.parse(originalText); } catch (e) { - console.error('解密失败:', e); + // console.error('解密失败:', e); return text; // 解密失败返回原始数据 } }; @@ -199,6 +199,7 @@ const proxyService = (params: any, customConfigs?: CustomConfigs) => { // response 拦截器 service.interceptors.response.use( (response) => { + debugger response.data.data = $Decrypt(response.data.data) return response; }, diff --git a/src/views/Jyh/AI/Home/index.vue b/src/views/Jyh/AI/Home/index.vue index 271ec36..f8f7053 100644 --- a/src/views/Jyh/AI/Home/index.vue +++ b/src/views/Jyh/AI/Home/index.vue @@ -53,10 +53,10 @@
- - + + - +
@@ -276,16 +276,16 @@ const onSubmit = async (e, answer = undefined) => { // 刷新回答(重新发送上一个用户问题) const handleRefresh = (index: number) => { - const currentMsg = messages.value[index]; - if (currentMsg.role === 'ai-model' && currentMsg.question) { // 假设AI回答的question字段存储了用户原始问题 - onSubmit(currentMsg.question); // 调用原有发送方法 + const currentMsg = messages.value[index-1]; + if (currentMsg.role === 'user' && currentMsg.content) { // 假设AI回答的question字段存储了用户原始问题 + onSubmit(currentMsg.content); // 调用原有发送方法 } }; // 复制回答内容 const handleFile = (index: number) => { const currentMsg = messages.value[index]; - if (currentMsg.role === 'ai-model') { + if (currentMsg.role === 'ai-model' || currentMsg.role === 'system') { const content = currentMsg.content || ''; // 处理富文本或特殊格式(示例中直接提取文本) const textContent = typeof content === 'string' ? content : JSON.stringify(content); @@ -305,8 +305,8 @@ const handleFile = (index: number) => { // 点赞/点踩处理 const handleLike = (index: number, type: 'like' | 'dislike') => { const currentMsg = messages.value[index]; - if (currentMsg.role === 'ai-model' && currentMsg.id) { // 假设消息有唯一ID - messages.value[currentMsg.id].islike = type; + if (currentMsg.role === 'ai-model' || currentMsg.role === 'system') { + messages.value[index].islike = type; // // 调用接口(示例中需替换为实际API) // axios.post('/api/rateConversation', { @@ -1077,4 +1077,8 @@ onMounted(() => { } } } + +.icon-dislike-solid { + transform: scaleX(-1) rotate(180deg); +}