mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-07 10:17:47 +02:00
fix(backup): download file link url issues
This commit is contained in:
1
config/env/torrents.js
vendored
1
config/env/torrents.js
vendored
@@ -31,7 +31,6 @@ module.exports = {
|
||||
backup: {
|
||||
enable: true,
|
||||
dir: './modules/backup/client/backup/'
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
vm.user = Authentication.user;
|
||||
vm.DLS = DownloadService;
|
||||
vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage;
|
||||
vm.backupConfig = MeanTorrentConfig.meanTorrentConfig.backup;
|
||||
|
||||
vm.deleteList = [];
|
||||
|
||||
@@ -67,6 +68,8 @@
|
||||
mtDebug.info(items);
|
||||
vm.buildPager();
|
||||
});
|
||||
|
||||
mtDebug.info(vm.backupConfig.dir);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
<tbody>
|
||||
<tr class="message-item" ng-repeat="f in vm.pagedItems">
|
||||
<td class="td-v-middle">
|
||||
<a href="/backup/download/{{f.name}}"
|
||||
<a href="{{vm.backupConfig.dir.substr(1)}}{{f.name}}"
|
||||
target="_self"
|
||||
ng-click="vm.DLS.downloadBackupFile(f.name); $event.preventDefault(); $event.stopPropagation();">{{f.name}}</a>
|
||||
</td>
|
||||
<td class="td-v-middle text-center">
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user