Change login from http basic auth to cookies

This commit is contained in:
Yukino Song
2024-08-30 06:17:02 +08:00
parent c0e65632f6
commit 652661ea50
11 changed files with 289 additions and 109 deletions

View File

@@ -4,7 +4,7 @@ import {createI18n} from "vue-i18n";
import en from './public/assets/locale/en.json'
export default async function() {
let r = await (await fetch("/api/configLocale")).json();
let r = await (await fetch("/api/configLocale", { credentials: 'include' })).json();
let locale = r.locale ?? "en";
document.querySelector('html').setAttribute('lang', locale);
let messages = {
@@ -12,7 +12,7 @@ export default async function() {
};
try {
if (locale !== 'en') {
let r = await (await fetch(`/assets/locale/${locale}.json`)).json();
let r = await (await fetch(`/assets/locale/${locale}.json`, { credentials: 'include' })).json();
messages[locale] = r;
}
} catch (e) {