common.js 741 Bytes
//设置当前页面导航栏背景色
function addTabs(id) {
    $('.layui-nav-item').removeClass('layui-this')
    $(id).addClass('layui-this')
}

//设置ajax调取服务接口

function SetServicesPath() {
    return "http://192.168.2.108"
}

//设置全局參數
var portal =
{
    'api_url': "http://192.168.2.108:8000",        //属性名用引号括起来,属性间由逗号隔开
    'name': 'myName'
};

//截取日期
function CutDate(times) {
    var timearr = times.replace(" ", ":").replace(/\:/g, "-").split("-");
    var timestr = "" + timearr[0] + "/" + timearr[1] + "/" + timearr[2]
    //var timestr = "" + timearr[1].split("")[1] + "月" + timearr[2] + "日\t" + timearr[3] + ":" + timearr[4] + ""
    return timestr
}