forked from kidgrow-microservices-platform

zhaoxiaohao
2020-04-20 6ec40d5a0c145ccffd1a28841f1c732f764e3e44
kidgrow-web/kidgrow-web-manager/src/main/resources/static/module/index.js
@@ -192,19 +192,32 @@
            layer.load(2);
            admin.req('api-user/users/current', {}, function (data) {
                layer.closeAll('loading');
                // console.log(data.code);
                // debugger;
                // console.log(data);
                if (data && data.code === 0) {
                    let user = data.data;
                    // console.log(user);
                    // debugger;
                    config.putUser(user);
                    admin.putTempData("permissions",user.permissions);
                    success(user);
                } else {
                    layer.msg('获取用户失败', {icon: 2});
                    if (data.code === 1000) {
                        layer.msg(data.msg, { icon: 2, time: 4 * 1000 }, function () {
                            //回调
                    config.removeToken();
                    location.replace('login.html');
                        })
                    } else {
                        layer.msg('获取用户失败,请联系管理员', { icon: 2, time: 4 * 1000 }, function () {
                            //回调
                            config.removeToken();
                            location.replace('login.html');
                        })
                    }
                }
            }, 'GET');
        },