Преглед изворни кода

fix #104: Bug: Redirect doesn't work when using 'crowi-plus Simplified Behavior'

Yuki Takei пре 8 година
родитељ
комит
c3a25d3325
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      lib/routes/page.js

+ 5 - 0
lib/routes/page.js

@@ -188,6 +188,11 @@ module.exports = function(crowi, app) {
 
     Page.findPage(path, req.user, req.query.revision)
     .then(function(page) {
+      // redirect
+      if (page.redirectTo) {
+        return res.redirect(encodeURI(page.redirectTo + '?redirectFrom=' + page.path));
+      }
+
       renderVars.page = page;
 
       if (page) {