forked from kidgrow-microservices-platform

luliqiang
2020-12-31 6fb14149d62199cfcc0448c82eb2f51f9c5181de
kidgrow-web/kidgrow-web-manager/src/main/resources/static/assets/js/common.js
@@ -269,7 +269,6 @@
};
//从当前页面的url地址中获取参数数据
function getRequest() {
    debugger
    var url = location.search; //获取url中"?"符后的字串
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
@@ -282,7 +281,8 @@
    return theRequest;
}
    /**
 * 自动将没权限的按钮隐藏
     * 1.判断用户是否在登录状态
 * 2.自动将没权限的按钮隐藏
 * 如果页面有列表,则在列表的 done事件内调用
 * 如果页面没有列表,则在页面所有js执行的最后调用此函数
 * 
@@ -290,7 +290,21 @@
 * 同时在控件上增加permissions="user-btn-import"这样的自定义属性 
 * 其中引号内是菜单管理--里面对应的资源的菜单path
 */
function permissionsInput() {
function permissionsInput(res,config) {
    if(!strUtil.isEmpty(res)&&res.code==401){
        config.removeToken();
        if(res.msg.includes("Access token expired")){
            layer.msg('登录过期', {icon: 2, time: 1500}, function () {
                location.replace('/login.html');
            }, 5000);
        }else if(res.msg.includes("Invalid access token")){
            layer.msg('您的账号在其他地方登陆,请重新登录或修改密码', {icon: 2, time: 1500}, function () {
                location.replace('/login.html');
            }, 5000);
        }
        return;
    }
    var needpPermissions = $(".permissions");
    var permissions = layui.sessionData('tempData')['permissions'];
    needpPermissions.each(function () {