Refactored store

This commit is contained in:
cracklesparkle
2024-06-25 15:56:00 +09:00
parent 85f97e9e0e
commit 18fb120777
15 changed files with 205 additions and 113 deletions

View File

@ -1,16 +1,19 @@
import axios from "axios";
import axiosInstance from "../http/axiosInstance";
export default class AuthService {
static async hello() {
return await axios.get(`${import.meta.env.VITE_API_AUTH_URL}/hello`)
static async login(data: any) {
return await axiosInstance.post(`/auth/login`, data, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
}
static async getUsers() {
return await axiosInstance.get(`/auth/user`)
static async refreshToken(token: string) {
return await axiosInstance.post(`/auth/refresh_token/${token}`)
}
static async getCurrentUser(token: string){
static async getCurrentUser(token: string) {
return await axiosInstance.get(`/auth/get_current_user/${token}`)
}
}