kaori 4 лет назад
Родитель
Сommit
c60227e7b9
1 измененных файлов с 8 добавлено и 2 удалено
  1. 8 2
      src/server/routes/forgot-password.js

+ 8 - 2
src/server/routes/forgot-password.js

@@ -1,5 +1,5 @@
 module.exports = function(crowi, app) {
 module.exports = function(crowi, app) {
-  const { /* appService, */ mailService } = crowi;
+  const { /* appService, */ mailService, configManager } = crowi;
   const path = require('path');
   const path = require('path');
   const actions = {};
   const actions = {};
   const api = {};
   const api = {};
@@ -26,7 +26,13 @@ module.exports = function(crowi, app) {
   }
   }
 
 
   api.post = async function(req, res) {
   api.post = async function(req, res) {
-    const i18n = req.language;
+    let i18n;
+
+    if (req.language == null) {
+      i18n = configManager.getConfig('crowi', 'app:globalLang');
+    }
+    i18n = req.language;
+
     await sendPasswordResetEmail(i18n);
     await sendPasswordResetEmail(i18n);
     return;
     return;
   };
   };