feat: login & check user

This commit is contained in:
naiba
2024-11-03 23:29:32 +08:00
parent 772d66334e
commit b1a0b607da
10 changed files with 157 additions and 11 deletions
+10
View File
@@ -0,0 +1,10 @@
import { User } from "@/types"
import { fetcher, FetcherMethod } from "./api"
export const getProfile = async (): Promise<User> => {
return fetcher<User>(FetcherMethod.GET, '/api/v1/profile', null)
}
export const login = async (username: string, password: string): Promise<any> => {
return fetcher<any>(FetcherMethod.POST, '/api/v1/login', { username, password })
}