16 lines
558 B
TypeScript
16 lines
558 B
TypeScript
import {http, objectToFormData} from '@/lib'
|
|
import type {LoginParams, LoginResponse, ValidateTokenResponse} from "@/types/auth.type.ts";
|
|
|
|
/** @description 登录获取token */
|
|
export const login = (params: LoginParams) => http.get<LoginResponse>('v1/temLogin', {
|
|
searchParams: params,
|
|
})
|
|
|
|
/** @description Token 验证 */
|
|
export const validateToken = (token: string): Promise<ValidateTokenResponse> => {
|
|
const formData = objectToFormData({token})
|
|
return http.post<ValidateTokenResponse>('v1/mall/verifyToken', {
|
|
body: formData,
|
|
})
|
|
}
|