add user lock for chat api, Prevent insufficient deduction of user power caused by submitting multiple requests at one time

This commit is contained in:
GeekMaster
2025-09-12 15:05:14 +08:00
parent 65fb58585c
commit c5badb3e13
43 changed files with 309 additions and 429 deletions

View File

@@ -178,10 +178,13 @@ const props = defineProps({
const selectedModel = ref(props.items[0])
const requiredKeys = ref(props.requiredKeys)
const emit = defineEmits(['update:modelValue'])
const emit = defineEmits(['update:modelValue', 'update:requiredKeys'])
// 初始化 modelValue 默认值
const initModelValue = (model) => {
if (props.items.length === 0) {
return {}
}
const defaultValues = {}
requiredKeys.value = {}
if (model && model.params) {
@@ -250,6 +253,7 @@ watch(
() => props.items,
(newValue) => {
selectedModel.value = newValue[0]
modelValue.value = initModelValue(selectedModel.value)
},
{ deep: true }
)