/** 登录接口 POST /api/login/account */ import { request } from 'umi'; import { projectObj } from '@/config/api'; import UserStorage from '@/config/sagacare/sagacare_user'; function getProjectId() { const id = projectObj.projectId; return id; } function commonParams() { var userObj = UserStorage.getInstance(); const user = userObj.getUser(); var pubname = 'sgadmin'; return `openid=${user.id}&pubname=${pubname}&projectId=${getProjectId()}&userId=${ user.id }&userName=${user.name}&userPhone=${user.phone}`; } 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/getDeviceTimeManageData' return request( `/sgadmin/duoduo-service/setup-service/deviceManage/getDeviceTimeManageData?${commonParams()}`, { method: 'GET', params: { ...params, }, ...(options || {}), }, ); } // chart export async function queryPropertyData(params: any, options?: { [key: string]: any }) { return request( `/sgadmin/duoduo-service/duoduoenv-service/spaceAdjust/queryPropertyData?${commonParams()}`, { method: 'GET', params: params, ...(options || {}), }, ); } // 有人无人 export async function getSpaceAdjustArray(body: any, otherParam: any) { return request(`/sgadmin/server/space/queryAll?${commonParams()}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, data: body, }); } 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 getSeasonType(params: any, options?: { [key: string]: any }) { return request( `/sgadmin/duoduo-service/custom-service/custom/getSeasonType`, { method: 'GET', headers: { 'Content-Type': 'application/json', }, ...(options || {}), params: { ...params, }, }, ); } 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 || {}), }); }