mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:12:51 +00:00
fix: Quick issue, API parameters cannot be carried (#2808)
This commit is contained in:
parent
189e2a6c63
commit
9c36d8f30a
|
|
@ -327,22 +327,10 @@ const checkInputParam = () => {
|
|||
// 浏览器query参数找到接口传参
|
||||
let msg = []
|
||||
for (let f of apiInputFieldList.value) {
|
||||
if (!api_form_data_context.value[f.field]) {
|
||||
let _value = getRouteQueryValue(f.field)
|
||||
if (_value != null) {
|
||||
api_form_data_context.value[f.field] = _value
|
||||
}
|
||||
}
|
||||
if (f.required && !api_form_data_context.value[f.field]) {
|
||||
msg.push(f.field)
|
||||
}
|
||||
}
|
||||
if (!api_form_data_context.value['asker']) {
|
||||
const asker = getRouteQueryValue('asker')
|
||||
if (asker) {
|
||||
api_form_data_context.value['asker'] = getRouteQueryValue('asker')
|
||||
}
|
||||
}
|
||||
|
||||
if (msg.length > 0) {
|
||||
MsgWarning(
|
||||
|
|
@ -352,6 +340,22 @@ const checkInputParam = () => {
|
|||
}
|
||||
return true
|
||||
}
|
||||
const initRouteQueryValue = () => {
|
||||
for (let f of apiInputFieldList.value) {
|
||||
if (!api_form_data_context.value[f.field]) {
|
||||
let _value = getRouteQueryValue(f.field)
|
||||
if (_value != null) {
|
||||
api_form_data_context.value[f.field] = _value
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!api_form_data_context.value['asker']) {
|
||||
const asker = getRouteQueryValue('asker')
|
||||
if (asker) {
|
||||
api_form_data_context.value['asker'] = getRouteQueryValue('asker')
|
||||
}
|
||||
}
|
||||
}
|
||||
const decodeQuery = (query: string) => {
|
||||
try {
|
||||
return decodeURIComponent(query)
|
||||
|
|
@ -383,6 +387,7 @@ defineExpose({ checkInputParam, render, renderDebugAiChat })
|
|||
onMounted(() => {
|
||||
firstMounted.value = true
|
||||
handleInputFieldList()
|
||||
initRouteQueryValue()
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
Loading…
Reference in New Issue