itizawa 4 лет назад
Родитель
Сommit
9ba8fa26c2
2 измененных файлов с 7 добавлено и 0 удалено
  1. 5 0
      src/server/routes/admin.js
  2. 2 0
      src/server/routes/index.js

+ 5 - 0
src/server/routes/admin.js

@@ -489,5 +489,10 @@ module.exports = function(crowi, app) {
     return res.json(ApiResponse.success());
     return res.json(ApiResponse.success());
   };
   };
 
 
+  actions.notFound = {};
+  actions.notFound.index = function(req, res) {
+    return res.render('admin/not_found');
+  };
+
   return actions;
   return actions;
 };
 };

+ 2 - 0
src/server/routes/index.js

@@ -115,6 +115,8 @@ module.exports = function(crowi, app) {
   app.get('/admin/export'                       , loginRequiredStrictly , adminRequired ,admin.export.index);
   app.get('/admin/export'                       , loginRequiredStrictly , adminRequired ,admin.export.index);
   app.get('/admin/export/:fileName'             , loginRequiredStrictly , adminRequired ,admin.export.api.validators.export.download(), admin.export.download);
   app.get('/admin/export/:fileName'             , loginRequiredStrictly , adminRequired ,admin.export.api.validators.export.download(), admin.export.download);
 
 
+  app.get('/admin/*'                       , loginRequiredStrictly ,adminRequired, admin.notFound.index);
+
   app.get('/me'                       , loginRequiredStrictly , me.index);
   app.get('/me'                       , loginRequiredStrictly , me.index);
   // external-accounts
   // external-accounts
   app.get('/me/external-accounts'                         , loginRequiredStrictly , me.externalAccounts.list);
   app.get('/me/external-accounts'                         , loginRequiredStrictly , me.externalAccounts.list);