mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-25 08:33:53 +08:00
@@ -52,7 +52,7 @@ export default {
|
||||
modelName: formData.modelName,
|
||||
isDefault: formData.isDefault ? 1 : 0,
|
||||
isEnabled: formData.isEnabled ? 1 : 0,
|
||||
configJson: JSON.stringify(formData.configJson),
|
||||
configJson: formData.configJson,
|
||||
docLink: formData.docLink,
|
||||
remark: formData.remark,
|
||||
sort: formData.sort || 0
|
||||
@@ -125,4 +125,39 @@ export default {
|
||||
});
|
||||
}).send();
|
||||
},
|
||||
// 获取单个模型配置
|
||||
getModelConfig(id, callback) {
|
||||
RequestService.sendRequest()
|
||||
.url(`${getServiceUrl()}/models/${id}`)
|
||||
.method('GET')
|
||||
.success((res) => {
|
||||
RequestService.clearRequestTime()
|
||||
callback(res)
|
||||
})
|
||||
.fail((err) => {
|
||||
console.error('获取模型配置失败:', err)
|
||||
this.$message.error(err.msg || '获取模型配置失败')
|
||||
RequestService.reAjaxFun(() => {
|
||||
this.getModelConfig(id, callback)
|
||||
})
|
||||
}).send()
|
||||
},
|
||||
// 启用/禁用模型状态
|
||||
updateModelStatus(id, status, callback) {
|
||||
RequestService.sendRequest()
|
||||
.url(`${getServiceUrl()}/models/enable/${id}/${status}`)
|
||||
.method('PUT')
|
||||
.success((res) => {
|
||||
RequestService.clearRequestTime()
|
||||
callback(res)
|
||||
})
|
||||
.fail((err) => {
|
||||
console.error('更新模型状态失败:', err)
|
||||
this.$message.error(err.msg || '更新模型状态失败')
|
||||
RequestService.reAjaxFun(() => {
|
||||
this.updateModelStatus(id, status, callback)
|
||||
})
|
||||
}).send()
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user