Skip to content

Commit

Permalink
更新存储插件
Browse files Browse the repository at this point in the history
  • Loading branch information
trheyi committed Apr 15, 2015
1 parent 6ee4f4c commit ecfa89a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions content/storage/qiniu-store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ QINIUStore.prototype.save = function (image) {
var uptoken = putPolicy.token();
var key = options.prefix + filename;

console.log( 'QINIUStore::UPLOAD filename=', filename );
// console.log( 'QINIUStore::UPLOAD filename=', filename );
// console.log( 'QINIUStore::image.path=', image.path );
// console.log( 'QINIUStore::qiniu.conf=', qiniu.conf );
// console.log( 'QINIUStore::uptoken=', uptoken );
console.log( 'QINIUStore::UPLOAD key=', key );
// console.log( 'QINIUStore::UPLOAD key=', key );

// 上传文件到云存储
qiniu.io.putFile(uptoken, key, image.path, null, function(err, ret) {
Expand All @@ -64,7 +64,7 @@ QINIUStore.prototype.save = function (image) {
// ret.key & ret.hash
} else {
// 上传失败, 处理返回代码
// console.log('QINIUStore save ERROR:' , err );
console.log('QINIUStore save ERROR:' , err );
return reject( err );
}
});
Expand All @@ -82,8 +82,8 @@ QINIUStore.prototype.exists = function (filename ) {
var key = options.prefix + filename;
var client = new qiniu.rs.Client();

console.log( 'QINIUStore::CHECK key=', key );
console.log( 'QINIUStore::CHECK filename=', filename );
// console.log( 'QINIUStore::CHECK key=', key );
// console.log( 'QINIUStore::CHECK filename=', filename );

client.stat( options.bucket , key, function(err, ret) {
if (!err) {
Expand Down Expand Up @@ -118,7 +118,6 @@ QINIUStore.prototype.serve = function () {
res.redirect( 301, options.protocol + '://' + options.domain + '/' + options.prefix + mountPoint + req.path );
// next();
};

};

module.exports = QINIUStore;

0 comments on commit ecfa89a

Please sign in to comment.