window.rootPath = (function(src) {
    src = document.scripts[document.scripts.length - 1].src;
    return src.substring(0, src.lastIndexOf("/") + 1);
})();

var base = '', dir = '';
if(localStorage.getItem("staticDomain")){
    dir = localStorage.getItem("staticDomain") + "/";
    base = localStorage.getItem("staticDomain") + "/component/laytp/module/";

}else{
    dir = "";
    base = rootPath + "module/";
}

layui.config({
    dir: dir, // 此值影响layui.addcss方法
    base: base, //设定扩展的Layui模块的所在目录，一般用于外部模块扩展
    version: localStorage.getItem("version") //js和css文件统一版本号
}).use(['theme','facade'], function () {
    // 设置主题
    layui.theme.changeTheme(window, false);
});