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

Merge pull request #10076 from weseek/fix/get-site-url-calling

fix: Unhandled exception in GlobalNotificationMailService
mergify[bot] 9 месяцев назад
Родитель
Сommit
f415781ad6

+ 1 - 1
apps/app/src/pages/utils/commons.ts

@@ -88,7 +88,7 @@ export const getServerSideCommonProps: GetServerSideProps<CommonProps> = async(c
     namespacesRequired: ['translation'],
     currentPathname,
     appTitle: appService.getAppTitle(),
-    siteUrl: configManager.getConfig('app:siteUrl'), // DON'T USE appService.getSiteUrl()
+    siteUrl: configManager.getConfig('app:siteUrl'), // DON'T USE growiInfoService.getSiteUrl()
     confidential: appService.getAppConfidential() || '',
     customTitleTemplate: customizeService.customTitleTemplate,
     csrfToken: req.csrfToken(),

+ 2 - 1
apps/app/src/server/service/global-notification/global-notification-mail.js

@@ -2,6 +2,7 @@ import nodePath from 'path';
 
 import { GlobalNotificationSettingEvent, GlobalNotificationSettingType } from '~/server/models/GlobalNotificationSetting';
 import { configManager } from '~/server/service/config-manager';
+import { growiInfoService } from '~/server/service/growi-info';
 import loggerFactory from '~/utils/logger';
 
 const logger = loggerFactory('growi:service:GlobalNotificationMailService'); // eslint-disable-line no-unused-vars
@@ -65,7 +66,7 @@ class GlobalNotificationMailService {
 
     const path = page.path;
     const appTitle = this.crowi.appService.getAppTitle();
-    const siteUrl = this.crowi.appService.getSiteUrl();
+    const siteUrl = growiInfoService.getSiteUrl();
     const pageUrl = new URL(page._id, siteUrl);
 
     let subject;