initial: add login
This commit is contained in:
7
controller/AuthController.ts
Normal file
7
controller/AuthController.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { api } from "@/config";
|
||||
import { API_PATH_LOGIN } from "@/constants";
|
||||
|
||||
export async function login(body: Model.LoginRequestBody) {
|
||||
console.log("Login request body:", body);
|
||||
return api.post<Model.LoginResponse>(API_PATH_LOGIN, body);
|
||||
}
|
||||
3
controller/index.ts
Normal file
3
controller/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import * as AuthController from "./AuthController";
|
||||
|
||||
export { AuthController };
|
||||
9
controller/typings.d.ts
vendored
Normal file
9
controller/typings.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
declare namespace Model {
|
||||
interface LoginRequestBody {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
interface LoginResponse {
|
||||
token?: string;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user