mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-07 00:51:19 +00:00
frontend: normalize auth oauth i18n and error toasts
This commit is contained in:
1 parent
4c21320d1b
commit
a6b919eb53
25 files changed
+909
-472
No files matched your search
@@ -6,6 +6,7 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref, computed } from 'vue'
|
||||
import type { Toast, ToastType, PublicSettings } from '@/types'
|
||||
import { i18n } from '@/i18n'
|
||||
import {
|
||||
checkUpdates as checkUpdatesAPI,
|
||||
type VersionInfo,
|
||||
@@ -209,7 +210,10 @@ export const useAppStore = defineStore('app', () => {
|
||||
try {
|
||||
return await operation()
|
||||
} catch (error) {
|
||||
const message = errorMessage || (error as { message?: string }).message || 'An error occurred'
|
||||
const message =
|
||||
errorMessage ||
|
||||
(error as { message?: string }).message ||
|
||||
i18n.global.t('common.unknownError')
|
||||
showError(message)
|
||||
return null
|
||||
} finally {
|
||||
|
||||
Reference in new issue
Block a user