opentiny / tiny-engine-webservice

Tiny Engine Web Service is a RESTful API responsible for providing data services, code generation services, and code release services to the front end. It does not directly operate on the database, and data operations request interfaces from TinyEngine Data Center.
MIT License
30 stars 28 forks source link

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

Open artifyfun opened 3 months ago

artifyfun commented 3 months ago

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

Issues-translate-bot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: 🐛 [Bug]: JSON is not verified when synchronizing materials, resulting in JSON that cannot be parsed and stored in the database.

Lu17301156525 commented 6 days ago

你通过前端脚本同步物料数据到后端数据库,插入的数据有问题,有json格式的数据,但是你入库的数据并不是json,所以报这个错,检查下数据库里面组件的数据格式

Issues-translate-bot commented 6 days ago

Bot detected the issue body's language is not English, translate it automatically.


You synchronize material data to the back-end database through the front-end script. There is a problem with the inserted data. There is json format data, but the data you put into the database is not json, so this error is reported. Check the data format of the components in the database.