fixed bug for mobile chat page change chat model not work

This commit is contained in:
RockYang 2024-05-21 17:54:03 +08:00
parent 7f1ec90748
commit 5742b40aee
3 changed files with 7 additions and 4 deletions

View File

@ -2,6 +2,7 @@
## v4.0.8
* 功能优化:当数据库更新失败的时候记录错误日志
* 功能优化:聊天输入框会随着输入内容的增多自动调整高度
* Bug修复修复移动端聊天页面模型切换不生效的Bug
## v4.0.7

View File

@ -13,8 +13,9 @@
.item {
display flex
flex-flow row
border 1px solid #3c3c3c
border 1px solid rgb(80,80,80)
padding 10px
background rgba(60,60,60 0.5)
.image {
width 80px

View File

@ -182,7 +182,7 @@ httpGet('/api/model/list').then(res => {
models.value[i].mValue = models.value[i].value
models.value[i].value = models.value[i].id
}
modelValue.value = getModelValue(modelId.value)
modelValue.value = getModelName(modelId.value)
//
httpGet(`/api/role/list`).then((res) => {
roles.value = res.data;
@ -236,6 +236,7 @@ const newChat = (item) => {
const options = item.selectedOptions
roleId.value = options[0].value
modelId.value = options[1].value
modelValue.value = getModelName(modelId.value)
chatId.value = ""
chatData.value = []
role.value = getRoleById(roleId.value)
@ -553,10 +554,10 @@ const getRoleById = function (rid) {
return null;
}
const getModelValue = (model_id) => {
const getModelName = (model_id) => {
for (let i = 0; i < models.value.length; i++) {
if (models.value[i].id === model_id) {
return models.value[i].mValue
return models.value[i].text
}
}
return ""