当前位置:网站首页>Handling abnormal data
Handling abnormal data
2022-06-12 08:36:00 【Month to month better】
According to the data returned by the back end , Filter out normal data , Get abnormal data display
The backend data is as follows :
let data = {
a: {
id: 1,
result: {
status: "error",
code: "HTTP_400",
message: "missing parameter"
}
},
b: {
id: 2,
result: {
status: "success",
code: "ok",
data: null
}
},
c: {
id: 3,
result: {
status: "success",
code: "ok",
data: null
}
}
};
The treatment is as follows :
function dealErrData(data) {
let keys = Object.keys(data);
let errData = [];
keys.forEach(item => {
if (data[item].result.code !== "ok") {
errData.push({
name: item, data: data[item] });
}
});
return errData;
}
console.log("errData:", dealErrData(data));

边栏推荐
- Vscade debug TS
- Error: what if the folder cannot be deleted when it is opened in another program
- vscode 下载慢解决办法
- What kind of sparks will be generated when the remote sensing satellite meets the Beidou navigation satellite?
- Production scheduling status of manufacturing enterprises and solutions of APS system
- (p27-p32) callable object, callable object wrapper, callable object binder
- ctfshow web3
- Why should enterprises implement MES? What are the specific operating procedures?
- Project sorting of niuke.com
- The Three Kingdoms kill the surrounding areas -------- explanation of the pig Kingdom kill problem
猜你喜欢

Beidou satellite navigation system foundation part 1

Error: what if the folder cannot be deleted when it is opened in another program

数据库基础——规范化、关系模式
![Easyexcel exports excel tables to the browser, and exports excel through postman test [introductory case]](/img/ca/0e2bd54a842a393231ec6db5ab02c2.png)
Easyexcel exports excel tables to the browser, and exports excel through postman test [introductory case]
![[advanced pointer III] implement C language quick sorting function qsort & callback function](/img/f0/3729db83ba3eb15c7df0958858ece9.png)
[advanced pointer III] implement C language quick sorting function qsort & callback function

How to understand the production scheduling of APS system?

Scope of bean

Hands on deep learning -- activation function and code implementation of multi-layer perceptron

Figure neural network makes Google maps more intelligent

三国杀周边--------猪国杀题解
随机推荐
MYSQL中的调用存储过程,变量的定义,
Audio and video related links
MES系统是什么?MES系统的操作流程是怎样?
FDA审查人员称Moderna COVID疫苗对5岁以下儿童安全有效
How to understand the production scheduling of APS system?
网站Colab与Kaggle
ctfshow web3
Jump to an interface at a specified time. (Web Development)
【进阶指针二】数组传参&指针传参&函数指针&函数指针数组&回调函数
Beidou satellite navigation system foundation part 1
企业上MES系统的驱动力来自哪里?选型又该注意哪些问题?
Bean的作用域
[essence] explain in detail the memory management mechanism in QT
X64dbg debugging exception_ ACCESS_ VIOLATION C0000005
Hands on learning and deep learning -- Realization of linear regression from scratch
余压监控系统保证火灾发生时消防疏散通道的通畅,为大型高层建筑的安全运行和人民生命财产安全保驾护航
[advanced pointer III] implement C language quick sorting function qsort & callback function
You have an error in your SQL syntax; use near ‘and title=‘xxx‘‘ at line 5
Where does the driving force of MES system come from? What problems should be paid attention to in model selection?
Build personal blog and web.