에이전트 기능 #38

Merged
klaus merged 6 commits from test into main 2026-04-14 10:00:41 +00:00
4 changed files with 60 additions and 2 deletions
Showing only changes of commit 8ce660d45e - Show all commits

View File

@@ -0,0 +1,25 @@
# 에이전트용 메뉴 추가 (기본 메뉴 생성)
- [x] SideMenu에서 getMenus 결과가 빈 배열일 때 기본 메뉴로 대체한다.
- [x] 기본 메뉴 항목: `{ title: '소속 크리에이터', route: '/agent/creators' }`
- [x] 라우터에 `/agent/creators` 경로를 추가한다. (DefaultLayout 하위)
- [x] 페이지 컴포넌트를 생성한다. (`src/views/Agent/Creators.vue`), 내용은 placeholder로 둔다.
## 배경/의도
- 에이전트용 메뉴가 아직 백엔드에 없어서 메뉴 조회 시 빈 배열이 내려올 가능성이 높다.
- 빈 배열일 때는 로그아웃 처리 대신 기본 단독 메뉴 ‘소속 크리에이터’를 제공해 접근할 수 있도록 한다.
## 구현 체크리스트
- [x] `SideMenu.vue``getMenus()`에서 성공(200/success)이고 `data.length === 0`이면 기본 메뉴로 할당
- [x] 기존처럼 성공 + 데이터 존재 시에는 응답 데이터를 그대로 사용
- [x] 라우터 `index.js``/agent/creators` children route 추가
- [x] `src/views/Agent/Creators.vue` 생성 및 라우터 연동
## 검증 기록
### 1차 구현
- 무엇을: 빈 메뉴 응답 시 기본 메뉴 노출 및 라우팅 동작 확인
- 왜: 에이전트용 메뉴가 없어도 최소 탐색 경로를 제공하기 위함
- 어떻게:
- 가정: API 응답이 `{ success: true, data: [] }`
- 기대: 사이드 메뉴에 ‘소속 크리에이터’ 단일 항목 표시, 클릭 시 `/agent/creators`로 이동하여 placeholder 화면 노출
- 결과: 로컬에서 메뉴가 빈 배열일 때 사이드 메뉴에 ‘소속 크리에이터’가 표시되고 클릭 시 `/agent/creators`로 이동하여 placeholder 화면이 노출됨을 확인함(수동 확인)

View File

@@ -92,8 +92,15 @@ export default {
this.isLoading = true this.isLoading = true
try { try {
let res = await api.getMenus(); let res = await api.getMenus();
if (res.status === 200 && res.data.success === true && res.data.data.length > 0) { if (res.status === 200 && res.data.success === true) {
if (res.data.data && res.data.data.length > 0) {
this.items = res.data.data this.items = res.data.data
} else {
// 빈 메뉴일 경우 기본 단독 메뉴를 제공한다.
this.items = [
{ title: '소속 크리에이터', route: '/agent/creators' }
]
}
} else { } else {
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 로그인 해주세요!") this.notifyError("알 수 없는 오류가 발생했습니다. 다시 로그인 해주세요!")
this.logoutWithoutNetwork(); this.logoutWithoutNetwork();

View File

@@ -20,6 +20,11 @@ const routes = [
name: 'ContentList', name: 'ContentList',
component: () => import(/* webpackChunkName: "content" */ '../views/Content/ContentList.vue') component: () => import(/* webpackChunkName: "content" */ '../views/Content/ContentList.vue')
}, },
{
path: '/agent/creators',
name: 'AgentCreators',
component: () => import(/* webpackChunkName: "agent" */ '../views/Agent/Creators.vue')
},
{ {
path: '/content/category/list', path: '/content/category/list',
name: 'ContentCategoryList', name: 'ContentCategoryList',

View File

@@ -0,0 +1,21 @@
<template>
<v-container fluid>
<v-row>
<v-col>
<h2>소속 크리에이터</h2>
<p class="mt-2 grey--text">
에이전트용 페이지입니다. 상세 내용은 추후에 추가될 예정입니다.
</p>
</v-col>
</v-row>
</v-container>
</template>
<script>
export default {
name: 'AgentCreators'
}
</script>
<style scoped>
</style>