修改初始数据脚本

This commit is contained in:
yulixing 2019-05-31 13:42:24 +08:00
parent c71040fb8a
commit 7a212e1535
2 changed files with 8 additions and 4 deletions

View File

@ -9,15 +9,19 @@ const platforms = require('./fixtures/platforms');
fixtures.clear(function(err) {
if (!err) {
console.log('正在加载初始数据')
fixtures.load(__dirname + '/fixtures/platforms.js', function(err) {
if (err) throw err;
console.log('平台加载完成')
});
fixtures.load(__dirname + '/fixtures/roles.js', function(err) {
if (err) throw err;
console.log('角色加载完成')
});
fixtures.load(__dirname + '/fixtures/system_dics.js', function(err) {
if (err) throw err;
});
// fixtures.load(__dirname + '/fixtures/system_dics.js', function(err) {
// if (err) throw err;
// console.log()
// });
} else {
throw err;
}

View File

@ -7,7 +7,7 @@
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "cross-env nodemon src/app.js --exec babel-node ",
"pro": "cross-env NODE_ENV=production nodemon src/app.js --exec babel-node ",
"init:roles": "node init-roles.js",
"init": "node init-data.js",
"clear": "node clear-data.js"
},
"keywords": [],