fix: /shareから/{国コード}/shareへのリダイレクト時にクエリパラメータが消える (#76)

* i18nRedirectorの修正 & TODO解消

* コメント削除
This commit is contained in:
ikasoba 2023-12-24 00:04:07 +09:00 committed by GitHub
parent 8450c38082
commit 9a0e2bf1b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -132,7 +132,7 @@ const generatedUrl = computed(() => {
visibleAccts: (visibility.value === 'specified') ? recipents.value.split('\n').join(',') : undefined, visibleAccts: (visibility.value === 'specified') ? recipents.value.split('\n').join(',') : undefined,
}; };
const baseUrl = 'https://misskey-hub.net'; /* ←正式リリース時に runtimeConfig.public.baseUrl に置換 */ const baseUrl = runtimeConfig.public.baseUrl;
return withQuery(joinURL(baseUrl, '/share/'), query); return withQuery(joinURL(baseUrl, '/share/'), query);
}); });

View File

@ -29,7 +29,7 @@ export default defineNitroPlugin((nitroApp) => {
html.head = remainingList.map((v) => v + '\n'); html.head = remainingList.map((v) => v + '\n');
//@ts-ignore //@ts-ignore
html.head.push('<script type="text/javascript">const s = ' + JSON.stringify(locales.map((l) => l.code)) + '; const d = new URLSearchParams(document.cookie); if (d.get(\'i18n_redirected\')) { location.replace(\'/\' + d.get(\'i18n_redirected\') + location.pathname); } else if (s.includes(navigator.language.split("-")[0])) { location.replace(\'/\' + navigator.language.split("-")[0] + location.pathname); } else { location.replace(\'/ja\' + location.pathname); }</script>\n'); html.head.push('<script type="text/javascript">const s = ' + JSON.stringify(locales.map((l) => l.code)) + '; const d = new URLSearchParams(document.cookie); if (d.get(\'i18n_redirected\')) { location.replace(\'/\' + d.get(\'i18n_redirected\') + location.pathname + location.search); } else if (s.includes(navigator.language.split("-")[0])) { location.replace(\'/\' + navigator.language.split("-")[0] + location.pathname + location.search); } else { location.replace(\'/ja\' + location.pathname + location.search); }</script>\n');
html.body = [ html.body = [
'\n<noscript>Please enable Javascript to see this page properly.</noscript>\n', '\n<noscript>Please enable Javascript to see this page properly.</noscript>\n',
`<noscript>${links.join(', ')}</noscript>\n`, `<noscript>${links.join(', ')}</noscript>\n`,