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

This commit is contained in:
life
2015-02-23 22:19:34 +08:00
parent 44fe2926a0
commit 3a179380db
6 changed files with 23 additions and 7 deletions

13
node_modules/evt.js generated vendored
View File

@@ -1,5 +1,5 @@
var fs = require('fs');
var User = require('user');
// var User = require('user');
function log(o) {
console.log(o);
@@ -19,6 +19,7 @@ var Evt = {
leanoteUrl: 'http://localhost:9000',
port: 8008,
localUrl: 'http://127.0.0.1:8008',
dataBasePath: '',
getImageLocalUrl: function(fileId) {
return this.localUrl + '/api/file/getImage?fileId=' + fileId;
},
@@ -27,12 +28,20 @@ var Evt = {
},
// 项目绝对地址
getBasePath: function() {
var me = this;
// return dataBasePath; // process.cwd();
return process.cwd();
// return process.cwd();
return me.dataBasePath;
},
getAbsolutePath: function(relative) {
var me = this;
return me.getBasePath() + '/' + relative;
},
setDataBasePath: function(dataBasePath) {
var me = this;
console.log('...........')
console.log(dataBasePath);
me.dataBasePath = dataBasePath;
}
};
module.exports = Evt;