import { http } from '@/common/service/service.js' 
import configService from '@/common/service/config.service.js';
const apiService = {
	 
	 /**
	  * 登录
	  */
	login(params) {
		return http.post('/sys/mLogin',params)	
	},
	/**
	  * 手机号码登录
	  */
	phoneNoLogin(params) {
		return http.post('/sys/phoneLogin',params);
	},
	/**
	  * 退出
	  */
	logout(params) {
		return http.post('/sys/logout',params);
	},
	// 按系统查询设备分类信息
	getDeviceType(params){
		return http.get('/safety/ventanalyDeviceInfo/DeviceKind/queryBySystem',params);
	},
	
	// 查询各类设备的列表表头信息
	getShowColum(params){
		return http.get('/safety/ventanalyShowColum/show_colum',params);
	},
	// 按系统查询设备监测信息
	getDeviceMonitor(params){
		return http.post('/monitor/device',params);
	},
	
	/**
	 * 获取文件访问路径
	 * @param avatar
	 * @param subStr
	 * @returns {*}
	 */
	getFileAccessHttpUrl(avatar,subStr){
	    if(!subStr) subStr = 'http'
	    if(avatar && avatar.startsWith(subStr)){
	        return avatar;
	    }else{
	        return configService.staticDomainURL + "/" + avatar;
	    }
	}
};

export default apiService;
