rt-sim-training-client/src/utils/mapList.js

15 lines
482 B
JavaScript
Raw Normal View History

2019-11-08 16:22:05 +08:00
import { getSessionStorage } from '@/utils/auth';
import { listPublishMap, getMapListByProjectCode } from '@/api/jmap/map';
import { ProjectCode } from '@/scripts/ConstDic';
export async function getMapListByProject() {
const project = getSessionStorage('project');
let mapList = [];
if (project.endsWith('xty')) {
mapList = await getMapListByProjectCode(ProjectCode[project]);
} else {
mapList = await listPublishMap();
}
return mapList;
}