feat: 支持平台代登录客户工作台

This commit is contained in:
2026-08-08 10:14:07 +08:00
parent 0b2380689c
commit c4540c1c0c
7 changed files with 85 additions and 6 deletions
+10
View File
@@ -21,6 +21,12 @@ export interface RegisterMerchantResult {
nextStep: string
}
export interface ImpersonationExchangeResult {
tokenType: string
accessToken: string
expiresIn: number
}
export function loginMerchant(username: string, password: string) {
return apiRequest<TokenPair>({ method: 'POST', url: '/auth/login', data: { username, password } })
}
@@ -36,3 +42,7 @@ export function logoutMerchant(refreshToken: string) {
export function changeCurrentPassword(oldPassword: string, newPassword: string) {
return apiRequest<void>({ method: 'PUT', url: '/auth/password', data: { oldPassword, newPassword } })
}
export function exchangeImpersonationCode(code: string) {
return apiRequest<ImpersonationExchangeResult>({ method: 'POST', url: '/auth/impersonations/exchange', data: { code } })
}