| | |
| | | layui.config({ |
| | | base: '/module/' |
| | | }).extend({ |
| | | formSelects: 'formSelects/formSelects-v4', |
| | | treetable: 'treetable-lay/treetable', |
| | | treetable2: 'treetable2/TreeTable', |
| | | autocomplete: 'complete/autocomplete', |
| | | step: 'step-lay/step' |
| | | }).use(['layer'], function () { |
| | | }).use(['layer','config', 'index', 'element'], function () { |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | let config = layui.config; |
| | | let index = layui.index; |
| | | let element = layui.element; |
| | | |
| | | // 检查是否登录 |
| | | if (!config.getToken() || config.getToken() == '') { |
| | | location.replace('login.html'); |
| | | return; |
| | | } |
| | | |
| | | // 检查多标签功能是否开启 |
| | | index.checkPageTabs(); |
| | | |
| | | // 获取当前用户信息 |
| | | index.getUser(function (user) { |
| | | $('.layui-layout-admin .layui-header').vm(user); |
| | | index.initLeftNav(); |
| | | element.render('nav'); |
| | | index.initRouter(); |
| | | index.bindEvent(); |
| | | }); |
| | | // 加载设置的主题 |
| | | var theme = layui.data('easyweb').theme; |
| | | if (theme) { |
| | |
| | | * @returns {} |
| | | */ |
| | | isEmpty:function(str){ |
| | | if(str != '' && str != undefined && str != null && str.length > 0){ |
| | | if(str != '' && str != undefined && str != null){ |
| | | return false; |
| | | }else{ |
| | | return true; |
| | |
| | | } |
| | | return true; |
| | | } |
| | | }; |
| | | }; |
| | | //从当前页面的url地址中获取参数数据 |
| | | function getRequest() { |
| | | debugger |
| | | var url = location.search; //获取url中"?"符后的字串 |
| | | var theRequest = new Object(); |
| | | if(url.indexOf("?") != -1) { |
| | | var str = url.substr(1); |
| | | strs = str.split("&"); |
| | | for(var i = 0; i < strs.length; i++) { |
| | | theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]); |
| | | } |
| | | } |
| | | return theRequest; |
| | | } |