You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
482 B
TypeScript
28 lines
482 B
TypeScript
// services/userService.ts
|
|
import { apiClient } from '../utils/apiClient';
|
|
import { type User } from '@/types/User'
|
|
|
|
|
|
export interface LoginParams {
|
|
UserName: string;
|
|
PassWord: string;
|
|
}
|
|
|
|
// 登录响应类型
|
|
export interface LoginResponse {
|
|
Code: string;
|
|
Data: {
|
|
user: any;
|
|
token: string;
|
|
},
|
|
Msg: string;
|
|
}
|
|
|
|
|
|
export const login = async (params: LoginParams) => {
|
|
return apiClient<LoginResponse>('/User/login', {
|
|
method: 'POST',
|
|
body: params
|
|
});
|
|
};
|