Browse Source

fix: add type for error

master
i5ting 3 years ago
parent
commit
ce60cfa30e
  1. 4
      packages/core/src/mods/settingBar/components/json/index.tsx

4
packages/core/src/mods/settingBar/components/json/index.tsx

@ -174,7 +174,7 @@ const EditModal: React.FC<IEditorModalProps> = (props) => {
try { try {
const codeObj = JSON.parse(json); const codeObj = JSON.parse(json);
formRef.current && formRef.current.setValue(codeObj); formRef.current && formRef.current.setValue(codeObj);
} catch (error) { } catch (error: any) {
console.log( console.log(
"can't parse code string to form schema, the error is:", "can't parse code string to form schema, the error is:",
error.message, error.message,
@ -213,7 +213,7 @@ const EditModal: React.FC<IEditorModalProps> = (props) => {
JSON.parse(json); JSON.parse(json);
onOk(json); onOk(json);
} }
} catch (error) { } catch (error: any) {
message.error('内容必须是合法json'); message.error('内容必须是合法json');
console.log('save failed, the error is:', error.message); console.log('save failed, the error is:', error.message);
} }

Loading…
Cancel
Save