mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-21 05:19:42 +08:00
chore: 完善log提示
This commit is contained in:
parent
96b5e36a5d
commit
f660c20788
@ -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)
|
||||
throw new Error(err.message);
|
||||
})
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user