fix: avatar 以及 auth 重构

This commit is contained in:
Tim
2025-10-17 15:10:43 +08:00
parent 61f8fa4bb7
commit f17b644a9b
14 changed files with 67 additions and 114 deletions

View File

@@ -1,5 +1,5 @@
import { toast } from '../main'
import { setToken, loadCurrentUser } from './auth'
import { setToken } from './auth'
import { registerPush } from './push'
export function telegramAuthorize(inviteToken = '') {
@@ -34,7 +34,6 @@ export async function telegramExchange(authData, inviteToken = '', reason = '')
const data = await res.json()
if (res.ok && data.token) {
setToken(data.token)
await loadCurrentUser()
toast.success('登录成功')
registerPush?.()
return { success: true, needReason: false }