api link to page
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import MainLogoSvg from './svgs/mainlogosvg';
|
||||
import apiService from './lib/apiService';
|
||||
|
||||
export default function Home() {
|
||||
const router = useRouter();
|
||||
@@ -133,23 +134,13 @@ export default function Home() {
|
||||
return;
|
||||
}
|
||||
|
||||
const apiUrl = process.env.NEXT_PUBLIC_API_BASE_URL
|
||||
? `${process.env.NEXT_PUBLIC_API_BASE_URL}/auth/me`
|
||||
: 'https://hrdi.coconutmeet.net/auth/me';
|
||||
const response = await apiService.getCurrentUser();
|
||||
|
||||
const response = await fetch(apiUrl, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${token}`,
|
||||
},
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
if (response.status !== 200) {
|
||||
return;
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
const data = response.data;
|
||||
|
||||
if (isMounted) {
|
||||
// 사용자 권한 확인
|
||||
|
||||
Reference in New Issue
Block a user