12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import axios from "axios";
- const UserService = axios.create({
- withCredentials: true,
- baseURL: `https://api.amic.ru/api/v1`,
- headers: {
- "key":"Accept",
- "value":"application/json",
- "description":"",
- "type":"text",
- "enabled":true
- },
- });
- export default {
- registration(user) {
- return UserService.post("/user/authorization/register", {
- email: user.email,
- first_name: user.firstName,
- password_a: user.password_a,
- password_b: user.password_b,
- })
- .then(response => {
- return response;
- })
- .catch(error => {
- console.log(error)
- });
- },
- login(user) {
- return UserService.post("/user/authorization/login", {
- email: user.email,
- password: user.password
- })
- .then((response) => {
- console.log(response.data.data.AcessToken)
- return response.data.data.AcessToken
- })
- .catch((error) => {
- console.log(error)
- })
- },
- };
|