/** 登录接口 POST /api/login/account */ import { request } from 'umi'; import { projectId } from '@/config/api'; import userData from '@/config/user'; export async function getMapList(body: any, options?: { [key: string]: any }) { return request( `/sgadmin/duoduo-service/setup-service/map/queryMapInfo?${commonParams()}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, ...(options || {}), data: body, }, ); } export async function getBuildingList(body: any, options?: { [key: string]: any }) { //debugger; return request( `/sgadmin/duoduo-service/object-service/object/building/query?${commonParams()}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, ...(options || {}), data: body, }, ); } export async function getFloorList(body: any, options?: { [key: string]: any }) { // debugger; return request( `/sgadmin/duoduo-service/object-service/object/floor/query?${commonParams()}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, ...(options || {}), data: body, }, ); } export async function queryDeviceTimeManage(params: any, options?: { [key: string]: any }) { // '/api3/duoduo-service/setup-service/deviceManage/queryDeviceTimeManage' return request( `/sgadmin/duoduo-service/setup-service/deviceManage/queryDeviceTimeManage?${commonParams()}`, { method: 'GET', params: { ...params, }, ...(options || {}), }, ); } function getProjectId() { const id = projectId; return id; } function commonParams() { var userObj = userData.getInstance(); const user = userObj.getUser(); return `openid=${user.id}&pubname=sgadmin&projectId=${getProjectId()}&userId=${user.id}`; } // chart export async function queryPropertyData(params: any, options?: { [key: string]: any }) { return request( `/sgadmin/duoduo-service/duoduoenv-service/spaceAdjust/queryPropertyData`, { method: 'GET', params: params, ...(options || {}), }, ); } export async function queryEnvironmentParam(body: any, otherParam: { [key: string]: any }) { //api/duoduo-service/object-service/object/floor/queryParam return request( `/sgadmin/duoduo-service/object-service/object/floor/queryParam?endTime=${otherParam.endTime}&startTime=${otherParam.startTime}¶m=${otherParam.param}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, data: body, }, ); } export async function queryEquipStatistics(params: any, options?: { [key: string]: any }) { // return request( `/sgadmin/duoduo-service/object-service/object/equipment/queryEquipStatistics`, { method: 'GET', headers: { 'Content-Type': 'application/json', }, ...(options || {}), params: { ...params, }, }, ); } export async function querySpace(body: any, options?: { [key: string]: any }) { // return request( `/sgadmin/duoduo-service/object-service/object/space/query?${commonParams()}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, ...(options || {}), data: body, }, ); } export async function checkToken(header: any, options?: { [key: string]: any }) { return request(`/sgadmin/duoduo-service/setup-service/user/zjCheckToken`, { method: 'GET', headers: { 'Content-Type': 'application/json', ...header, }, ...(options || {}), }); } //http://10.100.28.79/sgadmin/sso//auth/zjFreshCheckToken export async function reFreshCheckToken(header: any, options?: { [key: string]: any }) { return request(`/sgadmin/sso/auth/zjFreshCheckToken`, { method: 'GET', headers: { 'Content-Type': 'application/json', ...header, }, ...(options || {}), }); }