2026-08-03 19:12:33 +08:00
|
|
|
import { post } from '@/utils/request';
|
2026-08-05 16:02:01 +08:00
|
|
|
import type { LoginResult } from './types';
|
|
|
|
|
|
|
|
|
|
export type { LoginResult } from './types';
|
2026-08-03 19:12:33 +08:00
|
|
|
|
|
|
|
|
export const login = (params: { phone: string; password: string }) => {
|
2026-08-05 16:02:01 +08:00
|
|
|
return post(`/op/login`, params) as Promise<{
|
2026-08-07 11:20:30 +08:00
|
|
|
code: number | string;
|
2026-08-05 16:02:01 +08:00
|
|
|
msg: string;
|
|
|
|
|
data: LoginResult;
|
|
|
|
|
}>;
|
2026-08-03 19:12:33 +08:00
|
|
|
};
|
2026-08-07 11:26:49 +08:00
|
|
|
|
|
|
|
|
export const logout = () => {
|
|
|
|
|
return post(`/op/logout`) as Promise<{
|
|
|
|
|
code: number | string;
|
|
|
|
|
msg: string;
|
|
|
|
|
}>;
|
|
|
|
|
};
|