CheckDB.js 800 Bytes
Newer Older
1
import axios from 'axios';
Spark's avatar
Spark committed
2
3
import { Swal } from 'sweetalert2';

4
5
6
7
8
9

export async function callUserInfo() {
    const res = await axios.get("/api/user-info")
    return res.data.user_info
}

Spark's avatar
Spark committed
10
11
12
13
14
export function checkCookies() {
    const acctoken_cookies = document.cookie.split('=')[1];
    return acctoken_cookies;
}

15
export function deleteCookie(name) {
Spark's avatar
Spark committed
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
    document.cookie = name + '=; expires=Thu, 01 Jan 1999 00:00:10 GMT;';
    Swal.fire({
        title: '로그아웃 성공!',
        text: '🙏 안녕히 가세요 🙏',
        icon: 'warning',
        customClass: 'swal-wide',
        confirmButtonText: '확인',
    }).then((res) => {
        if (res.isConfirmed) {
            window.location.replace('/')
        }
        else {
            window.location.replace('/')
        }
    })
}