mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-07-28 09:28:30 +00:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
73a67b8f64 | ||
![]() |
222b3eaa4c | ||
![]() |
c4baccdc48 | ||
![]() |
7021a08ecf | ||
![]() |
e88b9bef13 | ||
![]() |
c17cc16c0e | ||
![]() |
d7d037618f | ||
![]() |
01edad7717 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -30,4 +30,3 @@ coverage
|
|||||||
|
|
||||||
# Environment variables files
|
# Environment variables files
|
||||||
/service/.env
|
/service/.env
|
||||||
/.env
|
|
||||||
|
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,3 +1,16 @@
|
|||||||
|
## v2.10.2
|
||||||
|
|
||||||
|
`2023-03-09`
|
||||||
|
|
||||||
|
衔接 `2.10.1` 版本[详情](https://github.com/Chanzhaoyu/chatgpt-web/releases/tag/v2.10.1)
|
||||||
|
|
||||||
|
## Enhancement
|
||||||
|
- 移动端下输入框获得焦点时左侧按钮隐藏
|
||||||
|
|
||||||
|
## BugFix
|
||||||
|
- 修复 `2.10.1` 中添加 `OPENAI_API_MODEL` 变量的判断错误,会导致默认模型指定失效,抱歉
|
||||||
|
- 回退 `2.10.1` 中前端变量影响 `Docker` 打包
|
||||||
|
|
||||||
## v2.10.1
|
## v2.10.1
|
||||||
|
|
||||||
`2023-03-09`
|
`2023-03-09`
|
||||||
@@ -24,7 +37,6 @@
|
|||||||
- 修复深色模式导出图片的样式问题
|
- 修复深色模式导出图片的样式问题
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## v2.10.0
|
## v2.10.0
|
||||||
|
|
||||||
`2023-03-07`
|
`2023-03-07`
|
||||||
|
@@ -266,7 +266,7 @@ PS: 不进行打包,直接在服务器上运行 `pnpm start` 也可
|
|||||||
|
|
||||||
#### 前端网页
|
#### 前端网页
|
||||||
|
|
||||||
1、参考根目录下 `.env.example` 文件内容创建 `.env` 文件,修改 `VITE_APP_API_BASE_URL` 为你的实际后端接口地址
|
1、修改根目录下 `.env` 文件中的 `VITE_APP_API_BASE_URL` 为你的实际后端接口地址
|
||||||
|
|
||||||
2、根目录下运行以下命令,然后将 `dist` 文件夹内的文件复制到你网站服务的根目录下
|
2、根目录下运行以下命令,然后将 `dist` 文件夹内的文件复制到你网站服务的根目录下
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "chatgpt-web",
|
"name": "chatgpt-web",
|
||||||
"version": "2.10.1",
|
"version": "2.10.2",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "ChatGPT Web",
|
"description": "ChatGPT Web",
|
||||||
"author": "ChenZhaoYu <chenzhaoyu1994@gmail.com>",
|
"author": "ChenZhaoYu <chenzhaoyu1994@gmail.com>",
|
||||||
|
@@ -31,11 +31,14 @@ let api: ChatGPTAPI | ChatGPTUnofficialProxyAPI
|
|||||||
// More Info: https://github.com/transitive-bullshit/chatgpt-api
|
// More Info: https://github.com/transitive-bullshit/chatgpt-api
|
||||||
|
|
||||||
if (process.env.OPENAI_API_KEY) {
|
if (process.env.OPENAI_API_KEY) {
|
||||||
|
const OPENAI_API_MODEL = process.env.OPENAI_API_MODEL
|
||||||
|
const model = (typeof OPENAI_API_MODEL === 'string' && OPENAI_API_MODEL.length > 0)
|
||||||
|
? OPENAI_API_MODEL
|
||||||
|
: 'gpt-3.5-turbo'
|
||||||
|
|
||||||
const options: ChatGPTAPIOptions = {
|
const options: ChatGPTAPIOptions = {
|
||||||
apiKey: process.env.OPENAI_API_KEY,
|
apiKey: process.env.OPENAI_API_KEY,
|
||||||
completionParams: {
|
completionParams: { model },
|
||||||
model: process.env.OPENAI_API_MODEL ?? 'gpt-3.5-turbo',
|
|
||||||
},
|
|
||||||
debug: false,
|
debug: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@ const chatStore = useChatStore()
|
|||||||
useCopyCode()
|
useCopyCode()
|
||||||
const { isMobile } = useBasicLayout()
|
const { isMobile } = useBasicLayout()
|
||||||
const { addChat, updateChat, updateChatSome, getChatByUuidAndIndex } = useChat()
|
const { addChat, updateChat, updateChatSome, getChatByUuidAndIndex } = useChat()
|
||||||
const { scrollRef, scrollToBottom, scrollToBottomIfAtBottom } = useScroll()
|
const { scrollRef, scrollToBottom } = useScroll()
|
||||||
|
|
||||||
const { uuid } = route.params as { uuid: string }
|
const { uuid } = route.params as { uuid: string }
|
||||||
|
|
||||||
@@ -34,6 +34,7 @@ const conversationList = computed(() => dataSources.value.filter(item => (!item.
|
|||||||
const prompt = ref<string>('')
|
const prompt = ref<string>('')
|
||||||
const loading = ref<boolean>(false)
|
const loading = ref<boolean>(false)
|
||||||
const usingContext = ref<boolean>(true)
|
const usingContext = ref<boolean>(true)
|
||||||
|
const actionVisible = ref<boolean>(true)
|
||||||
|
|
||||||
function handleSubmit() {
|
function handleSubmit() {
|
||||||
onConversation()
|
onConversation()
|
||||||
@@ -114,7 +115,7 @@ async function onConversation() {
|
|||||||
requestOptions: { prompt: message, options: { ...options } },
|
requestOptions: { prompt: message, options: { ...options } },
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
scrollToBottomIfAtBottom()
|
scrollToBottom()
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
//
|
//
|
||||||
@@ -165,10 +166,10 @@ async function onConversation() {
|
|||||||
requestOptions: { prompt: message, options: { ...options } },
|
requestOptions: { prompt: message, options: { ...options } },
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
scrollToBottom()
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
scrollToBottom()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,20 +368,20 @@ function handleStop() {
|
|||||||
|
|
||||||
function toggleUsingContext() {
|
function toggleUsingContext() {
|
||||||
usingContext.value = !usingContext.value
|
usingContext.value = !usingContext.value
|
||||||
if (usingContext.value) {
|
if (usingContext.value)
|
||||||
dialog.info({
|
ms.success(t('chat.turnOnContext'))
|
||||||
title: t('chat.usingContext'),
|
else
|
||||||
content: t('chat.turnOnContext'),
|
ms.warning(t('chat.turnOffContext'))
|
||||||
positiveText: t('common.yes'),
|
}
|
||||||
})
|
|
||||||
}
|
function onInputFocus() {
|
||||||
else {
|
if (isMobile.value)
|
||||||
dialog.info({
|
actionVisible.value = false
|
||||||
title: t('chat.usingContext'),
|
}
|
||||||
content: t('chat.turnOffContext'),
|
|
||||||
positiveText: t('common.yes'),
|
function onInputBlur() {
|
||||||
})
|
if (isMobile.value)
|
||||||
}
|
actionVisible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const placeholder = computed(() => {
|
const placeholder = computed(() => {
|
||||||
@@ -402,7 +403,7 @@ const wrapClass = computed(() => {
|
|||||||
const footerClass = computed(() => {
|
const footerClass = computed(() => {
|
||||||
let classes = ['p-4']
|
let classes = ['p-4']
|
||||||
if (isMobile.value)
|
if (isMobile.value)
|
||||||
classes = ['sticky', 'left-0', 'bottom-0', 'right-0', 'p-2', 'pr-4', 'overflow-hidden']
|
classes = ['sticky', 'left-0', 'bottom-0', 'right-0', 'p-2', 'overflow-hidden']
|
||||||
return classes
|
return classes
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -464,26 +465,30 @@ onUnmounted(() => {
|
|||||||
<footer :class="footerClass">
|
<footer :class="footerClass">
|
||||||
<div class="w-full max-w-screen-xl m-auto">
|
<div class="w-full max-w-screen-xl m-auto">
|
||||||
<div class="flex items-center justify-between space-x-2">
|
<div class="flex items-center justify-between space-x-2">
|
||||||
<HoverButton @click="handleClear">
|
<div v-if="actionVisible" class="flex items-center space-x-2">
|
||||||
<span class="text-xl text-[#4f555e] dark:text-white">
|
<HoverButton @click="handleClear">
|
||||||
<SvgIcon icon="ri:delete-bin-line" />
|
<span class="text-xl text-[#4f555e] dark:text-white">
|
||||||
</span>
|
<SvgIcon icon="ri:delete-bin-line" />
|
||||||
</HoverButton>
|
</span>
|
||||||
<HoverButton @click="handleExport">
|
</HoverButton>
|
||||||
<span class="text-xl text-[#4f555e] dark:text-white">
|
<HoverButton @click="handleExport">
|
||||||
<SvgIcon icon="ri:download-2-line" />
|
<span class="text-xl text-[#4f555e] dark:text-white">
|
||||||
</span>
|
<SvgIcon icon="ri:download-2-line" />
|
||||||
</HoverButton>
|
</span>
|
||||||
<HoverButton @click="toggleUsingContext">
|
</HoverButton>
|
||||||
<span class="text-xl" :class="{ 'text-[#4b9e5f]': usingContext, 'text-[#a8071a]': !usingContext }">
|
<HoverButton @click="toggleUsingContext">
|
||||||
<SvgIcon icon="ri:chat-history-line" />
|
<span class="text-xl" :class="{ 'text-[#4b9e5f]': usingContext, 'text-[#a8071a]': !usingContext }">
|
||||||
</span>
|
<SvgIcon icon="ri:chat-history-line" />
|
||||||
</HoverButton>
|
</span>
|
||||||
|
</HoverButton>
|
||||||
|
</div>
|
||||||
<NInput
|
<NInput
|
||||||
v-model:value="prompt"
|
v-model:value="prompt"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:autosize="{ minRows: 1, maxRows: 2 }"
|
:autosize="{ minRows: 1, maxRows: 2 }"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
|
@focus="onInputFocus"
|
||||||
|
@blur="onInputBlur"
|
||||||
@keypress="handleEnter"
|
@keypress="handleEnter"
|
||||||
/>
|
/>
|
||||||
<NButton type="primary" :disabled="buttonDisabled" @click="handleSubmit">
|
<NButton type="primary" :disabled="buttonDisabled" @click="handleSubmit">
|
||||||
|
Reference in New Issue
Block a user