소스 검색

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) {