🆕 修改好友列表设置AI角色为数据库配置

This commit is contained in:
李寻欢
2024-06-17 17:30:50 +08:00
parent 42339e3c51
commit a098da39ee
8 changed files with 120 additions and 0 deletions

View File

@@ -213,3 +213,26 @@ function aiModelChange(event, wxid) {
window.location.reload();
})
}
// AI角色变动
function aiAssistantChange(event, wxid) {
// 取出变动后的值
const assistantStr = event.target.value;
console.log("AI角色变动: ", wxid, assistantStr)
axios({
method: 'post',
url: '/api/ai/assistant',
data: {
wxid: wxid,
model: assistantStr
}
}).then(function (response) {
console.log(`返回结果: ${JSON.stringify(response)}`);
alert(`${response.data}`)
}).catch(function (error) {
console.log(`错误信息: ${error}`);
alert("修改失败")
}).finally(function () {
window.location.reload();
})
}