import axios from "./axios";
|
import md5 from "js-md5";
|
/**
|
* 登录系统
|
* 参数 "uinf.UName="+用户名+"&uinf.Upassword="+密码+"&uinf.UId="+是否记住密码(0,1)
|
* 密码需要使用hex_md5加密
|
*/
|
export const login = (username, password) => {
|
return axios({
|
method: "post",
|
url: `LoginAction_login?uinf.UName=${username}&uinf.Upassword=${md5(password)}&uinf.UId=0`,
|
data: null
|
})
|
}
|
|
/**
|
* 查询机房信息
|
* 参数:json = {"StationName1":"北京市","StationName2":"市辖区","StationName5":"海淀区"}
|
*/
|
export const searchStation = (params) => {
|
return axios({
|
method: "post",
|
url: "BattInfAction!serchAllStationName",
|
data: "json=" + JSON.stringify(params)
|
})
|
}
|
|
/**
|
* 查询已添加到地图的机房
|
* 参数:json={"adata":{"alm_cleared_type":0,"alm_id":1},"bplan":{"discharge_reason":3}}
|
*/
|
export const searchMap = () => {
|
return axios({
|
method: "post",
|
url: "BattMap_informationAction!searchUserManageStation",
|
data: "json=" + JSON.stringify({
|
adata: {
|
alm_cleared_type: 0,
|
alm_id: 1,
|
},
|
bplan: {
|
discharge_reason: 3,
|
}
|
})
|
})
|
}
|
|
export const searchMapHomeState = () => {
|
return axios({
|
method: "post",
|
url: 'BattMap_informationAction!findStationState',
|
data: null
|
});
|
}
|
|
/**
|
* 首页地图json数据配置 查询关联地图
|
* 参数: json={"id":id}
|
*/
|
export const getAllMapOutlineAction = (data) => {
|
return axios({
|
method: "post",
|
url: "MapOutlineAction!getAll",
|
data: 'json=' + JSON.stringify(data),
|
});
|
}
|
/**
|
* 检测用户的密码
|
* @param data 密码
|
* @returns {AxiosPromise}
|
*/
|
export const checkUserPwd = (data) => {
|
return axios({
|
method: "post",
|
url: "User_infAction!checkUserPass",
|
data: "addjson="+ md5(data),
|
});
|
}
|
/**
|
* 读取FGCD_A059放电参数
|
* @param data 传入json:{dev_id,op_cmd}
|
* @returns {AxiosPromise}
|
*/
|
export const getParams = (data) => {
|
return axios({
|
method: 'POST'
|
,url: 'Fbs9100_setparamAction_action_searchA059Param'
|
,data: 'json=' + JSON.stringify(data)
|
});
|
}
|
/**
|
* 启动
|
* @param data 启动命令
|
* @returns {AxiosPromise}
|
*/
|
export const start = (data) => {
|
return axios({
|
method: 'post',
|
url: 'Fbs9100_setparamAction_action_serchbyDev_id',
|
data: 'json='+JSON.stringify(data),
|
});
|
}
|
/**
|
* 查询电池组信息
|
* 参数:json = {"StationName1":"北京市","StationName2":"市辖区","StationName5":"海淀区","StationName3":"紫晶科技机房"}
|
*/
|
export const searchBattInfo = (params) => {
|
return axios({
|
method: "post",
|
url: "BattInfAction!serchAllBattinf",
|
data: "json=" + JSON.stringify(params)
|
})
|
}
|