初始化 ui.
This commit is contained in:
18
orion-ops-ui/src/api/user/auth.ts
Normal file
18
orion-ops-ui/src/api/user/auth.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import axios from 'axios';
|
||||
|
||||
export interface LoginRequest {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface LoginResponse {
|
||||
token: string;
|
||||
}
|
||||
|
||||
export function login(data: LoginRequest) {
|
||||
return axios.post<LoginResponse>('/infra/auth/login', data);
|
||||
}
|
||||
|
||||
export function logout() {
|
||||
return axios.get('/infra/auth/logout');
|
||||
}
|
||||
Reference in New Issue
Block a user