| | |
| | | console.error(error.message); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | export const fetchZoneList = async (zoneId) => { |
| | | try { |
| | | const res = await request.post('/map/zone/list', { |
| | | zoneId: zoneId, |
| | | }, { |
| | | headers: { 'Content-Type': 'application/x-www-form-urlencoded' } |
| | | }); |
| | | const { code, msg, data } = res.data; |
| | | if (code === 200) { |
| | | return data || []; |
| | | } else { |
| | | notify.error(msg); |
| | | return []; |
| | | } |
| | | } catch (error) { |
| | | notify.error(error.message); |
| | | console.error(error.message); |
| | | return []; |
| | | } |
| | | } |
| | | |
| | | export const saveZoneData = async (zoneId, zoneData) => { |
| | | try { |
| | | const res = await request.post('/map/zone/save', { |
| | | zoneId: zoneId, |
| | | zone: zoneData, |
| | | }); |
| | | const { code, msg } = res.data; |
| | | if (code !== 200) { |
| | | notify.error(msg); |
| | | } |
| | | } catch (error) { |
| | | notify.error(error.message); |
| | | console.error(error.message); |
| | | } |
| | | } |