/**
 * +------------------------------------------------------------
 * | 用户 (cim/user.js)
 * +------------------------------------------------------------
 * | @copyright: CIM (https://cimxx.com)
 * +------------------------------------------------------------
 */

;
(function (factory) {
    if (typeof define === "function" && define.amd) {
        define(factory);
    } else {
        if (typeof window.cim != "function") window.cim = {};
        window.cim.user = factory();
    }
})(function () {

    var user = {
        login: function () {
            console.log(new Date());
        },
        is_login: function () {
            if (sys.user.id == '') {
                layer.confirm('请登录后进行操作，现在登录吗？', {
                        btn: ['去登录', '再看看']
                    },
                    function () {
                        window.location = '/user/index/login';
                    },
                    function () {});
                return false;
            } else {
                return true;
            }
        },
    };

    return user;

});