Fix v2.7 工程

This commit is contained in:
ckcz123 2020-06-03 21:05:38 +08:00
parent bb1e8060bd
commit c60ae14ae2

View File

@ -6,7 +6,7 @@ editor_config.prototype.load = function(callback) {
var _this = this; var _this = this;
fs.readFile(this.address, "utf-8", function(e, d) { fs.readFile(this.address, "utf-8", function(e, d) {
if (e) { if (e) {
console.warn("无法读取配置文件, 已重新生成"); console.error("无法读取配置文件, 已重新生成");
_this.config = {}; _this.config = {};
_this.save(callback); _this.save(callback);
} else { } else {
@ -28,7 +28,7 @@ editor_config.prototype.set = function(key, value, callback) {
editor_config.prototype.save = function(callback) { editor_config.prototype.save = function(callback) {
fs.writeFile(this.address, JSON.stringify(this.config) ,'utf-8', function(e) { fs.writeFile(this.address, JSON.stringify(this.config) ,'utf-8', function(e) {
if (e) printe("写入配置文件失败"); if (e) console.error("写入配置文件失败");
if (callback instanceof Function) callback(); if (callback instanceof Function) callback();
}) })
} }