Просмотр исходного кода

Merge branch 'master' into fix/70354-adjust-access-token-parser

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

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

@@ -489,5 +489,10 @@ module.exports = function(crowi, app) {
     return res.json(ApiResponse.success());
   };
 
+  actions.notFound = {};
+  actions.notFound.index = function(req, res) {
+    return res.render('admin/not_found');
+  };
+
   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/: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);
   // external-accounts
   app.get('/me/external-accounts'                         , loginRequiredStrictly , me.externalAccounts.list);

+ 7 - 0
src/server/views/admin/not_found.html

@@ -0,0 +1,7 @@
+{% extends '../layout/admin.html' %}
+
+{% block html_title %}{{ customizeService.generateCustomTitleForFixedPageName(t('not_found_page.page_not_exist')) }}{% endblock %}
+
+{% block content_main %}
+<h1 class="title">{{ t('not_found_page.page_not_exist') }}</h1>
+{% endblock content_main %}