Commit dae8f140 authored by 崔佳豪's avatar 崔佳豪

fix: 修复消息混用1.0报错处理

parent 588ab34e
Pipeline #53752 passed with stages
...@@ -110,9 +110,9 @@ ...@@ -110,9 +110,9 @@
"@wisdom-map/arcgismap": "1.4.0-6", "@wisdom-map/arcgismap": "1.4.0-6",
"@wisdom-map/basemap": "1.1.0-2", "@wisdom-map/basemap": "1.1.0-2",
"@wisdom-map/util": "^1.0.27-0", "@wisdom-map/util": "^1.0.27-0",
"@wisdom-utils/components": "0.1.243", "@wisdom-utils/components": "0.1.244",
"@wisdom-utils/runtime": "0.0.32", "@wisdom-utils/runtime": "0.0.32",
"@wisdom-utils/utils": "0.1.283", "@wisdom-utils/utils": "0.1.284",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"antd": "^4.20.7", "antd": "^4.20.7",
"compression": "1.7.4", "compression": "1.7.4",
......
...@@ -77,11 +77,10 @@ const CheckAllMessage = props => { ...@@ -77,11 +77,10 @@ const CheckAllMessage = props => {
noticeService noticeService
.getAllInformationInfo(obj) .getAllInformationInfo(obj)
.then(res => { .then(res => {
console.log(res, 'res');
if (res.code === 0) { if (res.code === 0) {
pageIndex.current++; pageIndex.current++;
total.current = res.data.totalCount; total.current = res.data.totalCount;
res.data.list && setData([...data, ...res.data.list]); res.data.list && setData([...data, ...deaflData(res.data.list)]);
setIsRes(true); setIsRes(true);
setLoading(false); setLoading(false);
} }
...@@ -91,17 +90,28 @@ const CheckAllMessage = props => { ...@@ -91,17 +90,28 @@ const CheckAllMessage = props => {
setLoading(false); setLoading(false);
}) })
}; };
const deaflData = (data = []) => {
return data.map(item => {
let content = '';
try {
content = JSON.parse(item.infoContent)
content = item.infoContent;
} catch (error) {
content = '{}';
}
return { ...item, infoContent: content}
})
}
// 获取数据 // 获取数据
const getData = (obj) => { const getData = (obj) => {
noticeService noticeService
.getAllInformationInfo(obj) .getAllInformationInfo(obj)
.then(res => { .then(res => {
console.log(res, 'res');
if (res.code === 0) { if (res.code === 0) {
pageIndex.current++; pageIndex.current++;
total.current = res.data.totalCount; total.current = res.data.totalCount;
res.data.list && setData(res.data.list); res.data.list && setData(deaflData(res.data.list));
setLoading(false); setLoading(false);
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment