Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 84a19aa

Browse files
authored
fix: 更新JSON导入检查 (#523)
1 parent cf03b65 commit 84a19aa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/components/common/PromptStore/index.vue

+2
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ const importPromptTemplate = () => {
145145
try {
146146
const jsonData = JSON.parse(tempPromptValue.value)
147147
for (const i of jsonData) {
148+
if (!('key' in i) || !('value' in i))
149+
throw new Error('键值不匹配')
148150
let safe = true
149151
for (const j of promptList.value) {
150152
if (j.key === i.key) {

0 commit comments

Comments
 (0)