Skip to content

Commit 4bf1954

Browse files
author
frogo
committed
fix: 修复文章添加上传图片缩略图的地址错误不显示问题
1 parent 30f19ce commit 4bf1954

File tree

2 files changed

+452
-450
lines changed

2 files changed

+452
-450
lines changed

libs/uploader.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module.exports = function(opts) {
7676
if(url.indexOf(options.storage.options.domain) > -1) {
7777
try {
7878
client.delete(fileName, function(err) {
79-
callback && callback.call(null, err);
79+
callback && callback.call(null, err);
8080
})
8181
} catch(e) {
8282
console.log('删除7牛图片失败', e);
@@ -85,7 +85,7 @@ module.exports = function(opts) {
8585
} else {
8686
fs.unlink(options.uploadDir + '/' + fileName, function (err) {
8787
callback && callback.call(null, err);
88-
});
88+
});
8989
}
9090
} else {
9191
callback && callback.call(null, '文件类型错误');
@@ -144,7 +144,8 @@ module.exports = function(opts) {
144144
console.log('头部信息2',req.header)
145145
console.log('主机名:',host)
146146
result.push({
147-
url: initUrls(host, sName),
147+
// url: initUrls(host, sName),
148+
url: options.uploadUrl + encodeURIComponent(sName),
148149
name: sName,
149150
size: file.size,
150151
type: file.type
@@ -156,4 +157,4 @@ module.exports = function(opts) {
156157
}
157158
};
158159
return Uploader;
159-
};
160+
};

0 commit comments

Comments
 (0)