11 lines
291 B
TypeScript
11 lines
291 B
TypeScript
import axios from "axios";
|
|
import type { User } from "~/classes/User";
|
|
|
|
export function login(user: User, onSuccess: (token: string) => void)
|
|
{
|
|
axios.post<string>(ApiConfig.getHttpBase() + '/login', user)
|
|
.then((response) => {
|
|
onSuccess(response.data);
|
|
})
|
|
.catch();
|
|
} |