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

5
6

export async function callUserInfo() {
Spark's avatar
Spark committed
7
    const res = await axios.get(routesClient.userinfo)
8
    return res.data.contents.user_info
9
10
}

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

16
export function deleteCookie(name) {
Spark's avatar
Spark committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
    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('/')
        }
    })
}