fix(backup): download file link url issues

This commit is contained in:
OldHawk
2017-10-31 17:45:23 +08:00
parent 5e9449ebd8
commit e536f4c4bd
4 changed files with 10 additions and 4 deletions

View File

@@ -330,8 +330,11 @@ exports.postNewTopic = function (req, res) {
});
//replace content path
var regex = new RegExp('/modules/forums/client/attach/temp/', 'g');
topic.content = topic.content.replace(regex, '/modules/forums/client/attach/');
var tmp = config.uploads.attach.file.temp.substr(1);
var dst = config.uploads.attach.file.dest.substr(1);
var regex = new RegExp(tmp, 'g');
topic.content = topic.content.replace(regex, dst);
//save topic
topic.save(function (err) {