This commit is contained in:
Baobhan Sith
2025-04-26 11:22:03 +08:00
parent 2cd5a69bb2
commit ece81bf89e
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -293,8 +293,12 @@ export const useAuthStore = defineStore('auth', {
// NEW: 获取公共 CAPTCHA 配置 (修改为从 /settings/captcha 获取)
async fetchCaptchaConfig() {
console.log('[AuthStore] fetchCaptchaConfig called. Current publicCaptchaConfig:', JSON.stringify(this.publicCaptchaConfig)); // 添加日志
// Avoid refetching if already loaded
if (this.publicCaptchaConfig !== null) return;
if (this.publicCaptchaConfig !== null) {
console.log('[AuthStore] publicCaptchaConfig is not null, returning early.'); // 添加日志
return;
}
// Don't set isLoading for this, it should be quick background fetch
try {
@@ -93,6 +93,7 @@ const handleSubmit = async () => {
// Fetch CAPTCHA config on component mount
onMounted(() => {
console.log('[LoginView] Component mounted, calling fetchCaptchaConfig...'); // 添加日志
authStore.fetchCaptchaConfig();
});
</script>