api link to page

This commit is contained in:
2025-11-29 13:00:50 +09:00
parent 32e9fed5cd
commit 39d21a475b
11 changed files with 288 additions and 447 deletions

View File

@@ -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);