|
|
@@ -63,8 +63,15 @@ module.exports = function(crowi, app) {
|
|
|
|
|
|
Attachment.getListByPageId(id)
|
|
|
.then(function(attachments) {
|
|
|
+ var config = crowi.getConfig();
|
|
|
+ var baseUrl = (config.crowi['app:url'] || '');
|
|
|
return res.json(ApiResponse.success({
|
|
|
- attachments: attachments
|
|
|
+ attachments: attachments.map(at => {
|
|
|
+ var fileUrl = at.fileUrl;
|
|
|
+ at = at.toObject();
|
|
|
+ at.url = baseUrl + fileUrl;
|
|
|
+ return at;
|
|
|
+ })
|
|
|
}));
|
|
|
});
|
|
|
};
|