@wangofnextdoor/zlblog
Version:
浙里办日志和老年模式工具包
38 lines (37 loc) • 923 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultConfig = exports.ConfigManager = void 0;
// 默认应用配置
const defaultConfig = {
miniAppId: '',
miniAppName: '',
appKey: '',
serviceCode: '',
servicePwd: '',
appCode: '',
accessKey: '',
secret: '',
};
exports.defaultConfig = defaultConfig;
// 配置管理类
class ConfigManager {
constructor(config) {
this.config = { ...defaultConfig, ...config };
}
// 获取配置
getConfig() {
return { ...this.config };
}
// 更新配置
updateConfig(newConfig) {
this.config = { ...this.config, ...newConfig };
}
// 获取特定配置项
get(key) {
return this.config[key];
}
}
exports.ConfigManager = ConfigManager;
// 创建默认实例
const configManager = new ConfigManager();
exports.default = configManager.getConfig();