Skip to content

🐛 [Bug]: 同步物料时未校验JSON,导致无法parse的JSON入库 #13

@artifyfun

Description

@artifyfun

Environment

Chrome 版本 122.0.6261.129(正式版本) (64 位)

Version

v16.20.2

Version

@opentiny/vue@3.10.0

Link to minimal reproduction

最新

Step to reproduce

  1. 新增一个组件物料
  2. 执行 pnpm buildMaterials
  3. 提示新增成功,查看数据库已入库

但是刷新页面后,提示服务器500,查看是data-center报了错,有个物料JSON无法parse成功
[2024-03-28T11:17:34.667Z] debug GET /apps/918 (119 ms) 200
[2024-03-28T11:17:34.698Z] error SyntaxError: Expected ',' or '}' after property value in JSON at position 1257
SyntaxError: Expected ',' or '}' after property value in JSON at position 1257
at JSON.parse ()

检查数据库中新增的物料,确实无法parse,删除物料后刷新页面正常进入

建议入库前做个JSON校验

What is expected

No response

What is actually happening

No response

Any additional comments (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions