mirror of
https://gitee.com/h_mo/uniapp-vue3-vite-ts-template
synced 2025-04-05 19:41:44 +08:00
32 lines
535 B
TypeScript
32 lines
535 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, {
|
|
custom: {
|
|
auth: false,
|
|
},
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 登出
|
|
*/
|
|
export function logout() {
|
|
return request.post(LOGIN_OUT, {});
|
|
}
|
|
|
|
/**
|
|
* 刷新token
|
|
*/
|
|
export function refreshToken() {
|
|
return request.post<LoginModel>(REFRESH_TOKEN, {});
|
|
}
|