0

我的 java spring boot 应用程序正在发送包含多部分文件的 JSON,当调用 GET 时,我需要解析(使用角度)以便在“fileupload”中定位“picture”。

这是调用 GET 时进入 UI 的 JSON:

{
"id": 1,
"name": John,
"fileupload":  "MemberFile(id=1, fileId=1, fileName="sample.png", picture=[-119, 80, 78, 71, 13,..., -126])"
}

任何帮助将不胜感激。让我知道是否需要更多详细信息。谢谢

4

1 回答 1

0

用于JSON.parse将您的字符串解析为 javascript 对象。

const json = '{ "id": 1 "name": John "fileupload": "MemberFile(id=1, fileId=1, fileName="sample.png", picture=[-119, 80, 78, 71, 13,..., -126])" }';
const obj = JSON.parse(json);

console.log(obj);
// expected output: true
于 2021-08-08T07:15:03.153 回答