fix: DISABLE_ADMIN_PASSWORD_CHECK still show admin password modal (#406)

This commit is contained in:
Dream Hunter
2024-08-14 22:52:45 +08:00
committed by GitHub
parent d90f54345d
commit c969c4b082
9 changed files with 1672 additions and 1635 deletions

View File

@@ -56,6 +56,9 @@ const getOpenSettings = async (message) => {
try {
const res = await api.fetch("/open_api/settings");
const domainLabels = res["domainLabels"] || [];
if (res["domains"]?.length < 1) {
message.error("No domains found, please check your worker settings");
}
Object.assign(openSettings.value, {
...res,
title: res["title"] || "",

View File

@@ -27,6 +27,7 @@ export const useGlobalState = createGlobalState(
enableWebhook: false,
isS3Enabled: false,
showGithub: true,
disableAdminPasswordCheck: false,
})
const settings = ref({
fetched: false,
@@ -83,7 +84,11 @@ export const useGlobalState = createGlobalState(
/** @type {null | {domains: string[] | undefined | null, role: string, prefix: string | undefined | null}} */
user_role: null,
});
const showAdminPage = computed(() => !!adminAuth.value || userSettings.value.is_admin);
const showAdminPage = computed(() =>
!!adminAuth.value
|| userSettings.value.is_admin
|| openSettings.value.disableAdminPasswordCheck
);
const telegramApp = ref(window.Telegram?.WebApp || {});
const isTelegram = ref(!!window.Telegram?.WebApp?.initData);
return {