From 4ab5a7856e058b2141c202789fffca59b627621c Mon Sep 17 00:00:00 2001 From: suxiaoxin Date: Wed, 27 Sep 2017 10:33:06 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=AE=8C=E5=96=84log=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/install.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/install.js b/server/install.js index 888d0b35..0855383a 100755 --- a/server/install.js +++ b/server/install.js @@ -25,7 +25,7 @@ function setupSql() { let result = userInst.save({ username: yapi.WEBCONFIG.adminAccount.substr(0, yapi.WEBCONFIG.adminAccount.indexOf('@')), email: yapi.WEBCONFIG.adminAccount, - password: yapi.commons.generatePassword('qunar.com', passsalt), + password: yapi.commons.generatePassword('ymfe.org', passsalt), passsalt: passsalt, role: 'admin', add_time: yapi.commons.time(), @@ -126,16 +126,16 @@ function setupSql() { result.then(function () { fs.ensureFileSync(yapi.path.join(yapi.WEBROOT_RUNTIME, 'init.lock')); - console.log(`初始化管理员账号 "${yapi.WEBCONFIG.adminAccount}" 成功`); // eslint-disable-line + console.log(`初始化管理员账号成功,账号名:"${yapi.WEBCONFIG.adminAccount}",密码:"ymfe.org"`); // eslint-disable-line process.exit(0); }, function (err) { - console.log(`初始化管理员账号 "${yapi.WEBCONFIG.adminAccount}" 失败, ${err.message}`); // eslint-disable-line - process.exit(0); + throw new Error(`初始化管理员账号 "${yapi.WEBCONFIG.adminAccount}" 失败, ${err.message}`); // eslint-disable-line + }); - }).catch(function(err){ - console.log('Error:', err.message) + }).catch(function(err){ + throw new Error(err.message); }) }