api link to page
This commit is contained in:
@@ -158,23 +158,10 @@ export default function AdminLessonsPage() {
|
||||
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) {
|
||||
const data = await response.json();
|
||||
if (data.name) {
|
||||
setCurrentUser(data.name);
|
||||
}
|
||||
if (response.data && response.data.name) {
|
||||
setCurrentUser(response.data.name);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('사용자 정보 조회 오류:', error);
|
||||
|
||||
Reference in New Issue
Block a user