fix(forums): fixed normal user and vip/oper only forum access issues

normal user cannot view the vip/oper forum topics in 'global topics'
normal user can not view forum by url link enter, system well nav to forums home

#40 #20
This commit is contained in:
OldHawk
2017-12-04 16:39:37 +08:00
parent 2caa625f0e
commit 4af4b47d65
5 changed files with 52 additions and 25 deletions

View File

@@ -89,20 +89,23 @@
forumId: $stateParams.forumId
}, function (item) {
vm.forum = item;
vm.forumPath.splice(0, 0, {name: vm.forum.name, state: 'forums.view', params: {forumId: vm.forum._id}});
});
// get topics
TopicsService.get({
forumId: $stateParams.forumId,
topicId: $stateParams.topicId
}, function (topic) {
mtDebug.info(topic);
vm.topic = topic;
vm.buildPager();
// get topics
TopicsService.get({
forumId: $stateParams.forumId,
topicId: $stateParams.topicId
}, function (topic) {
mtDebug.info(topic);
vm.topic = topic;
vm.buildPager();
vm.forumPath.push({name: topic.title, state: undefined});
vm.forumPath.push({name: topic.title, state: undefined});
});
}, function (res) {
if (typeof res.data.redirect == 'string') {
$state.go(res.data.redirect);
}
});
};