fix fetch hook

This commit is contained in:
Gabe Yuan
2023-08-14 14:58:57 +08:00
parent d4be34d689
commit bcb9974253
2 changed files with 22 additions and 14 deletions

View File

@@ -14,6 +14,6 @@ export const useI18n = () => {
export const useI18nMd = (key) => {
const i18n = useI18n();
const fileName = i18n(key);
const url = `${URL_RAW_PREFIX}/${fileName}`;
return useFetch(fileName ? url : "");
const url = fileName ?? `${URL_RAW_PREFIX}/${fileName}`;
return useFetch(url);
};