feat: add loggedIn checks for frontend

This commit is contained in:
wancat committed 2023-09-17 12:29:45 +08:00
1 parent 34c277c886
commit d939b7eb4d
5 files changed
+37 -21

No files matched your search

+6
View File
@@ -1,5 +1,11 @@
import api from './api'
export async function isLoggedIn() {
const res = await api.get('/auth/check-session')
const { loggedIn } = res.data
return loggedIn
}
export const login = async (username, password) => {
try {
const res = await api.post('/auth/login', { username, password })