mirror of
https://gitee.com/h_mo/uniapp-vue3-vite-ts-template
synced 2025-04-06 03:58:03 +08:00
28 lines
472 B
TypeScript
28 lines
472 B
TypeScript
import { request } from '@/utils/http';
|
|
|
|
const LOGIN = '/login';
|
|
const LOGIN_OUT = '/logout';
|
|
const REFRESH_TOKEN = '/refresh/token';
|
|
|
|
/**
|
|
* 登录
|
|
* @param params
|
|
*/
|
|
export function login(params: LoginParams) {
|
|
return request.Post<LoginModel>(LOGIN, params);
|
|
}
|
|
|
|
/**
|
|
* 登出
|
|
*/
|
|
export function logout() {
|
|
return request.Post(LOGIN_OUT, {});
|
|
}
|
|
|
|
/**
|
|
* 刷新token
|
|
*/
|
|
export function refreshToken() {
|
|
return request.Post<LoginModel>(REFRESH_TOKEN, {});
|
|
}
|