登录后判断是否有数据文件夹, 如果没有, 则新建之

nw.gui为什么不存在?
This commit is contained in:
life
2015-02-21 23:08:16 +08:00
parent 4adb336b93
commit 0beb6f531b
13 changed files with 47 additions and 4 deletions

16
node_modules/evt.js generated vendored
View File

@@ -1,7 +1,20 @@
var fs = require('fs');
var User = require('user');
function log(o) {console.log(o)}
function log(o) {
console.log(o);
};
// 为什么不存在?
// var dataBasePath = require('nw.gui').App.dataPath; // + '/data';
/*
// 判断是否存在, 不存在则创建dir
if(!fs.existsSync(dataBasePath)) {
fs.mkdirSync(dataBasePath);
}
*/
dataBasePath = '';
var Evt = {
leanoteUrl: 'http://localhost:9000',
port: 8008,
@@ -14,6 +27,7 @@ var Evt = {
},
// 项目绝对地址
getBasePath: function() {
// return dataBasePath; // process.cwd();
return process.cwd();
},
getAbsolutePath: function(relative) {