const baseurl = 'http://192.168.0.187:5000/api/';
const api_key = 16859729202501;
const api_secret = "5B18352190E64BB3B1BC24CAE62DE700";
var station_id = '';
var access_token = '';
window._AMapSecurityConfig = {
    securityJsCode: '0711374220aba81dbf7515aaac08e50b',
}
// 自适应
resetFontSize();
function resetFontSize() {
    var baseFontSize = 100
    var designWidth = 1920
    var width = window.innerWidth;
    var maxWidth = 3280;
    var minWidth = 1260;
    width = Math.min(maxWidth, width);
    width = Math.max(minWidth, width);
    sizeScale = width / designWidth;
    var currentFontSize = Math.ceil(sizeScale * baseFontSize);
    document.getElementsByTagName('html')[0].style.fontSize = currentFontSize + 'px'
}
$(function () {
    window.onresize = function () {
        resetFontSize();
    };
})

function getTimestamp() {
	return Math.round(new Date().getTime()/10);
}

function sort(obj) {
	var newkey = Object.keys(obj).sort();
	var sortObj = {};
	for (var i = 0; i < newkey.length; i++) {
		sortObj[newkey[i]] = obj[newkey[i]];
	}
	let newObj = [];
	for (let i in sortObj) {
		var arr = {
			key: i,
			value: sortObj[i]
		}
		newObj.push(arr)
	}
	let str = '';
	for (let i = 0; i < newObj.length; i++) {
		if (newObj[i].value !== '' && newObj[i].key !== 'signcode') {
			str += newObj[i].key + newObj[i].value;
		}
	}
	console.log(str)
	return str;
}