| | |
| | | |
| | | // watch curFloor |
| | | React.useEffect(() => { |
| | | Utils.fetchMapData(curFloor); |
| | | }, [curFloor]); |
| | | |
| | | // didClickSprite, stop triggers both sprite click and play's selection boxs |
| | |
| | | } |
| | | |
| | | export const fetchMapData = async (curFloor) => { |
| | | console.log(curFloor); |
| | | clearMapData(); |
| | | await Http.doPostPromise('api/map/list', { floor: curFloor }, (res) => { |
| | | const mapItemList = res.data.itemList; |
| | | const mapItemList = eval(res.data); |
| | | mapItemList.forEach(item => { |
| | | let sprite; |
| | | switch (item.type) { |
| | |
| | | @Autowired |
| | | private DictService dictService; |
| | | |
| | | public MapDataParam getMapData(MapQueryParam param, Long userId) { |
| | | public String getMapData(MapQueryParam param, Long userId) { |
| | | String mapKey = getMapKey(param.getFloor()); |
| | | Dict dict = dictService.getOne(new LambdaQueryWrapper<Dict>().eq(Dict::getFlag, mapKey)); |
| | | if (Cools.isEmpty(dict)) { |
| | | return null; |
| | | } else { |
| | | return JSON.parseObject(dict.getValue(), MapDataParam.class) ; |
| | | return dict.getValue(); |
| | | } |
| | | } |
| | | |