diff --git a/lib/win32/index.js b/lib/win32/index.js index 6a9dee3..f6d7972 100644 --- a/lib/win32/index.js +++ b/lib/win32/index.js @@ -34,6 +34,7 @@ function setSettingValue(value) { if (err) { return reject(err); } + // result is undefind return resolve(result); }); }); @@ -69,7 +70,8 @@ module.exports = { } if (typeof cb === 'function') { try { - return cb(null, await setSettingValue(settings)); + await setSettingValue(settings); + return cb(null, await getSettings()); } catch (e) { return cb(e, null); } @@ -77,11 +79,14 @@ module.exports = { /** * 不传入 callback, 使用 Promise */ - return await setSettingValue(settings); + await setSettingValue(settings); + return await getSettings(); }, reset: async (cb) => { + /** get and return default settings */ if (!defaultConnectionSettings) { - return; + await init() + return defaultConnectionSettings; } if (typeof cb === 'function') { try {