feat: 项目接口联调
This commit is contained in:
15
src/api/auth.ts
Normal file
15
src/api/auth.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
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,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user