mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-10-20 10:45:13 +00:00
feat: 删除多余的内容
This commit is contained in:
@@ -25,7 +25,7 @@ defineProps<Props>()
|
||||
{{ date }}
|
||||
</span>
|
||||
<div class="p-2 mt-2 rounded-md" :class="[user ? 'bg-[#d2f9d1]' : 'bg-[#f4f6f8]']">
|
||||
<span class="leading-relaxed" :class="error ?? 'text-red-500'" v-html="message" />
|
||||
<span class="leading-relaxed" :class="[{ 'text-red-500': error }]" v-html="message" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -96,7 +96,12 @@ function addMessage(message: string, user = false, error = false) {
|
||||
</main>
|
||||
<footer class="p-4">
|
||||
<div class="flex items-center justify-between space-x-2">
|
||||
<NInput v-model:value="value" placeholder="Type a message" :disabled="loading" @keyup="handleEnter" />
|
||||
<NInput
|
||||
v-model:value="value"
|
||||
placeholder="Type a message"
|
||||
:disabled="loading"
|
||||
@keyup="handleEnter"
|
||||
/>
|
||||
<NButton type="primary" :loading="loading" @click="handleSubmit">
|
||||
<SvgIcon icon="ri:send-plane-fill" />
|
||||
</NButton>
|
||||
|
@@ -1,12 +1,14 @@
|
||||
import axios from 'axios'
|
||||
|
||||
async function fetchChatAPI(message: string) {
|
||||
const url = `${import.meta.env.VITE_GLOB_API_URL}/chat`
|
||||
|
||||
if (!message || message.trim() === '')
|
||||
return Promise.reject(new Error('Message is empty'))
|
||||
|
||||
try {
|
||||
const { status, data } = await axios.post(
|
||||
'http://192.168.110.170:3002/chat',
|
||||
url,
|
||||
{ message },
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user