feat(avatar): support production H5 token SSO
This commit is contained in:
@@ -428,7 +428,7 @@ export const getUserProfile = () =>
|
||||
export interface SmsLoginResult {
|
||||
token: string
|
||||
user: UserProfile & { huihuiUserId: string; phone: string; createdAt?: string; lastLoginAt?: string }
|
||||
huihui: { userId: string; nickname: string; avatarUrl: string; token: string }
|
||||
huihui: { userId: string; nickname: string; avatarUrl: string }
|
||||
}
|
||||
|
||||
// 发送短信验证码(演示模式会额外返回 devCode / dev 标记)
|
||||
@@ -443,6 +443,10 @@ export const loginBySms = (phone: string, code: string) =>
|
||||
export const loginByPassword = (account: string, password: string) =>
|
||||
request.post<SmsLoginResult>('/huihui/pwd/login', { account, password })
|
||||
|
||||
// Validate a production Huihui access token and exchange it for an app session.
|
||||
export const loginByHuihuiToken = (token: string) =>
|
||||
request.post<SmsLoginResult>('/huihui/token/login', { token })
|
||||
|
||||
// 当前登录用户
|
||||
export const getCurrentUser = () =>
|
||||
request.get<UserProfile & { huihuiUserId: string; phone: string }>('/huihui/me')
|
||||
|
||||
Reference in New Issue
Block a user