feat: request google login while refresh

This commit is contained in:
Tim
2025-07-23 15:49:41 +08:00
parent 33ddc3bb77
commit 7b22b2d15d
5 changed files with 35 additions and 24 deletions
+8 -1
View File
@@ -8,8 +8,9 @@ import './assets/toast.css'
// Use Sugar theme from vue-toast-notification for better toast styling.
// If you prefer Bootstrap style, replace with theme-bootstrap.css instead.
import { useToast } from 'vue-toastification'
import { checkToken, clearToken } from './utils/auth'
import { checkToken, clearToken, isLogin } from './utils/auth'
import { initTheme } from './utils/theme'
import { loginWithGoogle } from './utils/google'
// Configurable API domain and port
// export const API_DOMAIN = 'http://127.0.0.1'
@@ -47,4 +48,10 @@ checkToken().then(valid => {
if (!valid) {
clearToken()
}
if (!isLogin()) {
setTimeout(() => {
loginWithGoogle()
}, 3000)
}
})