完成“获取模型供应器列表”的API

This commit is contained in:
CGD
2025-04-03 14:31:57 +08:00
parent 4ea27cbdc2
commit 5b28cf6c66
2 changed files with 54 additions and 74 deletions
+17
View File
@@ -26,5 +26,22 @@ export default {
})
}).send()
},
// 获取模型供应器列表
getModelProviders(modelType, callback) {
RequestService.sendRequest()
.url(`${getServiceUrl()}/api/v1/models/${modelType}/provideTypes`)
.method('GET')
.success((res) => {
RequestService.clearRequestTime()
callback(res.data?.data || [])
})
.fail((err) => {
console.error('获取供应器列表失败:', err)
this.$message.error('获取供应器列表失败')
RequestService.reAjaxFun(() => {
this.getModelProviders(modelType, callback)
})
}).send()
}
}