mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
fix: 移除无用的认证提供方加载状态,简化登录逻辑
This commit is contained in:
+1
-7
@@ -107,8 +107,6 @@ interface PluginAuthPayload {
|
|||||||
|
|
||||||
// 登录认证提供方
|
// 登录认证提供方
|
||||||
const authProviders = ref<LoginAuthProvider[]>([])
|
const authProviders = ref<LoginAuthProvider[]>([])
|
||||||
const authProvidersLoaded = ref(false)
|
|
||||||
const authProvidersFailed = ref(false)
|
|
||||||
const selectedAuthProvider = ref<LoginAuthProvider | null>(null)
|
const selectedAuthProvider = ref<LoginAuthProvider | null>(null)
|
||||||
const RemoteAuthView = shallowRef<Component | null>(null)
|
const RemoteAuthView = shallowRef<Component | null>(null)
|
||||||
const pluginAuthDialog = ref(false)
|
const pluginAuthDialog = ref(false)
|
||||||
@@ -122,7 +120,7 @@ const pluginAuthProviders = computed(() =>
|
|||||||
authProviders.value.filter(provider => provider.type === 'plugin' && provider.remote && provider.enabled !== false),
|
authProviders.value.filter(provider => provider.type === 'plugin' && provider.remote && provider.enabled !== false),
|
||||||
)
|
)
|
||||||
const showPasskeyLogin = computed(
|
const showPasskeyLogin = computed(
|
||||||
() => !authProvidersLoaded.value || authProvidersFailed.value || !!systemPasskeyProvider.value?.enabled,
|
() => !!systemPasskeyProvider.value?.enabled,
|
||||||
)
|
)
|
||||||
|
|
||||||
// 生成 MFA 共享弹窗使用的最新 props。
|
// 生成 MFA 共享弹窗使用的最新 props。
|
||||||
@@ -170,13 +168,9 @@ async function loadAuthProviders() {
|
|||||||
try {
|
try {
|
||||||
const result = (await api.get('auth/providers')) as LoginAuthProvider[]
|
const result = (await api.get('auth/providers')) as LoginAuthProvider[]
|
||||||
authProviders.value = Array.isArray(result) ? result : []
|
authProviders.value = Array.isArray(result) ? result : []
|
||||||
authProvidersFailed.value = false
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('加载认证提供方失败:', error)
|
console.error('加载认证提供方失败:', error)
|
||||||
authProviders.value = []
|
authProviders.value = []
|
||||||
authProvidersFailed.value = true
|
|
||||||
} finally {
|
|
||||||
authProvidersLoaded.value = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user