123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- /** 登录接口 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<API.MapInfoRes>(
- `/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<API.BuildFloorList>(
- `/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<API.BuildFloorList>(
- `/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<API.DeviceTimeType>(
- `/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<API.DeviceTimeType>(
- `/sgadmin/duoduo-service/duoduoenv-service/spaceAdjust/queryPropertyData?${commonParams()}`,
- {
- method: 'GET',
- params: params,
- ...(options || {}),
- },
- );
- }
- // 有人无人
- export async function getSpaceAdjustArray(body: any, otherParam: any) {
- return request<API.DeviceTimeType>(`/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<API.EnvironmentParam>(
- `/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<API.EnvironmentParam>(
- `/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<API.EnvironmentParam>(
- `/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<API.EnvironmentParam>(
- `/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<API.EnvironmentParam>(`/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<API.EnvironmentParam>(`/sgadmin/sso/auth/zjFreshCheckToken`, {
- method: 'GET',
- headers: {
- 'Content-Type': 'application/json',
- ...header,
- },
- ...(options || {}),
- });
- }
|