美文网首页
web 配置存取

web 配置存取

作者: 田帅奇 | 来源:发表于2018-08-23 19:31 被阅读0次

简单的配置类,用于页面级别的配置数据存取

var conf = {};

exports.get = function (key, defaultVal) {
    if (conf.hasOwnProperty(key)) {
        return conf[key];
    }
    return defaultVal;
};

exports.set = function (key, val) {
    conf[key] = val;
};

相关文章

网友评论

      本文标题:web 配置存取

      本文链接:https://www.haomeiwen.com/subject/uigmiftx.html