Compare commits
97 Commits
test
...
7d694a4c36
| Author | SHA1 | Date | |
|---|---|---|---|
| 7d694a4c36 | |||
| cae9e9a430 | |||
| f90f8f6250 | |||
| abb15cb2c7 | |||
| b26837f258 | |||
| f42602886e | |||
| b8373829f0 | |||
| 2769c3c9f0 | |||
| 648d4d3a97 | |||
| 4baf253b7e | |||
| e0c63df2a6 | |||
| 892923becc | |||
| d3ea703204 | |||
| 70298b8f8f | |||
| 9fa9f3e699 | |||
| d82531583c | |||
| 6240a285c2 | |||
| f577ab575e | |||
| 0c3e3fc3fd | |||
| 6886c372aa | |||
| 8dd3dcb770 | |||
| 1a435b6074 | |||
| 492859dae3 | |||
| 18b59b5598 | |||
| 5fcdd7f06d | |||
| 1e149f7e41 | |||
| aca3767a24 | |||
| d51655f15e | |||
| 47dd32939f | |||
| 2e1891ab08 | |||
| 99d70cc8f7 | |||
| 9f1675e82d | |||
| c2838be2ed | |||
| b5c2941c0d | |||
| d5c01d8d23 | |||
| 7118b0649a | |||
| 8f5346581e | |||
| e43f2e30be | |||
| 397fd267e0 | |||
| fe4b88350b | |||
| 537474e162 | |||
| b5abdf3cf5 | |||
| a2e457b5e8 | |||
| 05ddd417cd | |||
| e70426af68 | |||
| 81b33e1322 | |||
| 588fcfbe90 | |||
| ff2c126382 | |||
| 702daca29f | |||
| 8e9008a3c1 | |||
| 5c0c00aad4 | |||
| e0949c6d73 | |||
| 0449bac8d5 | |||
| d412c15c9d | |||
| ed16a6ddad | |||
| f06e2d41e0 | |||
| 7505269db3 | |||
| 15eeb6943d | |||
| 7e7ed46cea | |||
| fd01786649 | |||
| c48c1c2f09 | |||
| 9bcf3a3cdb | |||
| 4c5b987d98 | |||
| f168403048 | |||
| 82ee1584e7 | |||
| 65cb918389 | |||
| 784baf9a2f | |||
| 7a85ac41cc | |||
| 9d4c9437cf | |||
| 68845aeae1 | |||
| bbdca29337 | |||
| c14c041daa | |||
| a515a144eb | |||
| 54a6773905 | |||
| d97087b4e9 | |||
| ddb2449053 | |||
| 8aca07cdf7 | |||
| 0ba845d95a | |||
| 64b1fd5395 | |||
| 639bea70fa | |||
| 6a89ba059b | |||
| ff83041585 | |||
| e660be0bf4 | |||
| 62cdd57069 | |||
| f8346ed5ef | |||
| 9656b9a9d1 | |||
| 97a58266bb | |||
| 8fc0cfa345 | |||
| 22f9c2287d | |||
| 9284f7d5c3 | |||
| e6f27a4529 | |||
| 6a33d1c024 | |||
| 3b83789c15 | |||
| 55f0ab9af3 | |||
| 9b168a6112 | |||
| c47937933e | |||
| 4744fe7d9a |
@@ -1,7 +1,7 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
|
||||||
async function login(email, password) {
|
async function login(email, password) {
|
||||||
return Vue.axios.post('/admin/member/login', {
|
return Vue.axios.post('/member/login', {
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
isAdmin: true,
|
isAdmin: true,
|
||||||
|
|||||||
@@ -94,135 +94,113 @@ 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) {
|
if (res.status === 200 && res.data.success === true && res.data.data.length > 0) {
|
||||||
// 기본 메뉴 설정 (API 결과가 비어있을 수 있음)
|
this.items = res.data.data
|
||||||
this.items = Array.isArray(res.data.data) ? res.data.data : []
|
|
||||||
|
|
||||||
// 현재 사용자 역할 확인
|
// '시리즈 관리' 메뉴에 '배너 등록' 하위 메뉴 추가
|
||||||
const role = (this.$store && this.$store.state && this.$store.state.accountStore && this.$store.state.accountStore.role)
|
try {
|
||||||
|| localStorage.role
|
const seriesMenu = this.items.find(m => m && m.title === '시리즈 관리')
|
||||||
|
if (seriesMenu) {
|
||||||
// ADMIN 권한 전용 추가 메뉴들
|
if (!Array.isArray(seriesMenu.items)) {
|
||||||
if (role === 'ADMIN') {
|
seriesMenu.items = seriesMenu.items ? [].concat(seriesMenu.items) : []
|
||||||
// '시리즈 관리' 메뉴에 '배너 등록' 하위 메뉴 추가
|
}
|
||||||
try {
|
const exists = seriesMenu.items.some(ci => ci && ci.route === '/content/series/banner')
|
||||||
const seriesMenu = this.items.find(m => m && m.title === '시리즈 관리')
|
if (!exists) {
|
||||||
if (seriesMenu) {
|
seriesMenu.items.push({
|
||||||
if (!Array.isArray(seriesMenu.items)) {
|
title: '배너 등록',
|
||||||
seriesMenu.items = seriesMenu.items ? [].concat(seriesMenu.items) : []
|
route: '/content/series/banner',
|
||||||
}
|
items: null
|
||||||
const exists = seriesMenu.items.some(ci => ci && ci.route === '/content/series/banner')
|
})
|
||||||
if (!exists) {
|
|
||||||
seriesMenu.items.push({
|
|
||||||
title: '배너 등록',
|
|
||||||
route: '/content/series/banner',
|
|
||||||
items: null
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
// ignore
|
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
|
||||||
// 캐릭터 챗봇 메뉴 추가
|
// 캐릭터 챗봇 메뉴 추가
|
||||||
this.items.push({
|
this.items.push({
|
||||||
title: '캐릭터 챗봇',
|
title: '캐릭터 챗봇',
|
||||||
|
route: null,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
title: '배너 등록',
|
||||||
|
route: '/character/banner',
|
||||||
|
items: null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '캐릭터 리스트',
|
||||||
|
route: '/character',
|
||||||
|
items: null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '큐레이션',
|
||||||
|
route: '/character/curation',
|
||||||
|
items: null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '정산',
|
||||||
|
route: '/character/calculate',
|
||||||
|
items: null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '원작',
|
||||||
|
route: '/original-work',
|
||||||
|
items: null
|
||||||
|
},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
// 에이전트 관리 메뉴를 '크리에이터 관리' 바로 아래에 추가
|
||||||
|
try {
|
||||||
|
const insertAfterTitle = '크리에이터 관리'
|
||||||
|
const agentMenu = {
|
||||||
|
title: '에이전트 관리',
|
||||||
route: null,
|
route: null,
|
||||||
items: [
|
items: [
|
||||||
{
|
{ title: '에이전트 리스트', route: '/agent/list', items: null },
|
||||||
title: '배너 등록',
|
{ title: '에이전트 정산 비율', route: '/agent/settlement-ratio', items: null },
|
||||||
route: '/character/banner',
|
|
||||||
items: null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '캐릭터 리스트',
|
|
||||||
route: '/character',
|
|
||||||
items: null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '큐레이션',
|
|
||||||
route: '/character/curation',
|
|
||||||
items: null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '정산',
|
|
||||||
route: '/character/calculate',
|
|
||||||
items: null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '원작',
|
|
||||||
route: '/original-work',
|
|
||||||
items: null
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
})
|
|
||||||
|
|
||||||
// 에이전트 관리 메뉴를 '크리에이터 관리' 바로 아래에 추가
|
|
||||||
try {
|
|
||||||
const insertAfterTitle = '크리에이터 관리'
|
|
||||||
const agentMenu = {
|
|
||||||
title: '에이전트 관리',
|
|
||||||
route: null,
|
|
||||||
items: [
|
|
||||||
{ title: '에이전트 리스트', route: '/agent/list', items: null },
|
|
||||||
{ title: '에이전트 정산 비율', route: '/agent/settlement-ratio', items: null },
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
const idx = this.items.findIndex(m => m && m.title === insertAfterTitle)
|
|
||||||
if (idx >= 0) {
|
|
||||||
this.items.splice(idx + 1, 0, agentMenu)
|
|
||||||
} else {
|
|
||||||
// 기준 메뉴가 없으면 하단에 추가
|
|
||||||
this.items.push(agentMenu)
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
// ignore
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 정산현황 메뉴에 '채널 후원 정산' 및 '오리지널 시리즈 정산' 추가
|
const idx = this.items.findIndex(m => m && m.title === insertAfterTitle)
|
||||||
try {
|
if (idx >= 0) {
|
||||||
const calculateMenu = this.items.find(m => m && m.title === '정산현황')
|
this.items.splice(idx + 1, 0, agentMenu)
|
||||||
if (calculateMenu) {
|
} else {
|
||||||
if (!Array.isArray(calculateMenu.items)) {
|
// 기준 메뉴가 없으면 하단에 추가
|
||||||
calculateMenu.items = calculateMenu.items ? [].concat(calculateMenu.items) : []
|
this.items.push(agentMenu)
|
||||||
}
|
|
||||||
const exists = calculateMenu.items.some(ci => ci && ci.route === '/calculate/channel-donation')
|
|
||||||
if (!exists) {
|
|
||||||
calculateMenu.items.push({
|
|
||||||
title: '채널 후원 정산',
|
|
||||||
route: '/calculate/channel-donation',
|
|
||||||
items: null
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const existsOriginal = calculateMenu.items.some(ci => ci && ci.route === '/calculate/original-series')
|
|
||||||
if (!existsOriginal) {
|
|
||||||
calculateMenu.items.push({
|
|
||||||
title: '오리지널 시리즈 정산',
|
|
||||||
route: '/calculate/original-series',
|
|
||||||
items: null
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
// ignore
|
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
// 조회한 메뉴가 비어 있고, 콘텐츠 매니저라면 기본 메뉴 추가
|
// 정산현황 메뉴에 '채널 후원 정산' 추가
|
||||||
if (this.items.length === 0 && role === 'CONTENT_MANAGER') {
|
try {
|
||||||
this.items.push({
|
const calculateMenu = this.items.find(m => m && m.title === '정산현황')
|
||||||
title: '콘텐츠 리스트',
|
if (calculateMenu) {
|
||||||
route: '/content/list',
|
if (!Array.isArray(calculateMenu.items)) {
|
||||||
items: null
|
calculateMenu.items = calculateMenu.items ? [].concat(calculateMenu.items) : []
|
||||||
})
|
}
|
||||||
}
|
const exists = calculateMenu.items.some(ci => ci && ci.route === '/calculate/channel-donation')
|
||||||
|
if (!exists) {
|
||||||
|
calculateMenu.items.push({
|
||||||
|
title: '채널 후원 정산',
|
||||||
|
route: '/calculate/channel-donation',
|
||||||
|
items: null
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 그래도 비어있다면 이전 동작과 동일하게 처리
|
// '오리지널 시리즈 정산' 추가
|
||||||
if (this.items.length === 0) {
|
const existsOriginal = calculateMenu.items.some(ci => ci && ci.route === '/calculate/original-series')
|
||||||
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 로그인 해주세요!")
|
if (!existsOriginal) {
|
||||||
this.logout();
|
calculateMenu.items.push({
|
||||||
|
title: '오리지널 시리즈 정산',
|
||||||
|
route: '/calculate/original-series',
|
||||||
|
items: null
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// ignore
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 로그인 해주세요!")
|
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 로그인 해주세요!")
|
||||||
|
|||||||
@@ -12,13 +12,17 @@ enhanceAccessToken();
|
|||||||
const accountStore = {
|
const accountStore = {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
state: {
|
state: {
|
||||||
|
userId: '',
|
||||||
|
nickname: '',
|
||||||
accessToken: '',
|
accessToken: '',
|
||||||
role: '',
|
profileImage: '',
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
isAuthenticated(state) {
|
isAuthenticated(state) {
|
||||||
|
state.userId = state.userId || localStorage.userId
|
||||||
|
state.nickname = state.nickname || localStorage.nickname
|
||||||
|
state.profileImage = state.profileImage || localStorage.profileImage
|
||||||
state.accessToken = state.accessToken || localStorage.accessToken
|
state.accessToken = state.accessToken || localStorage.accessToken
|
||||||
state.role = state.role || localStorage.role
|
|
||||||
|
|
||||||
return state.accessToken !== undefined &&
|
return state.accessToken !== undefined &&
|
||||||
state.accessToken !== null &&
|
state.accessToken !== null &&
|
||||||
@@ -27,19 +31,27 @@ const accountStore = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
LOGIN(state, {token, role}) {
|
LOGIN(state, {userId, nickname, token, profileImage}) {
|
||||||
|
state.userId = userId
|
||||||
|
localStorage.userId = userId
|
||||||
|
|
||||||
|
state.nickname = nickname
|
||||||
|
localStorage.nickname = nickname
|
||||||
|
|
||||||
|
state.profileImage = profileImage
|
||||||
|
localStorage.profileImage = profileImage
|
||||||
|
|
||||||
state.accessToken = token
|
state.accessToken = token
|
||||||
localStorage.accessToken = token
|
localStorage.accessToken = token
|
||||||
|
|
||||||
state.role = role
|
|
||||||
localStorage.role = role
|
|
||||||
|
|
||||||
Vue.axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
|
Vue.axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
|
||||||
},
|
},
|
||||||
|
|
||||||
LOGOUT(state) {
|
LOGOUT(state) {
|
||||||
|
state.userId = ''
|
||||||
|
state.nickname = ''
|
||||||
|
state.profileImage = ''
|
||||||
state.accessToken = ''
|
state.accessToken = ''
|
||||||
state.role = ''
|
|
||||||
|
|
||||||
localStorage.clear()
|
localStorage.clear()
|
||||||
if (location.pathname === '/') {
|
if (location.pathname === '/') {
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ export default {
|
|||||||
items: [],
|
items: [],
|
||||||
totalCount: 0,
|
totalCount: 0,
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 20,
|
pageSize: 10,
|
||||||
|
|
||||||
excelLoading: false,
|
excelLoading: false,
|
||||||
|
|
||||||
|
|||||||
@@ -135,8 +135,7 @@ export default {
|
|||||||
currency: 'KRW',
|
currency: 'KRW',
|
||||||
currencies: [
|
currencies: [
|
||||||
{ text: 'KRW (한국 원)', value: 'KRW' },
|
{ text: 'KRW (한국 원)', value: 'KRW' },
|
||||||
{ text: 'USD (미국 달러)', value: 'USD' },
|
{ text: 'USD (미국 달러)', value: 'USD' }
|
||||||
{ text: 'JPY (일본 엔)', value: 'JPY' }
|
|
||||||
],
|
],
|
||||||
headers: [
|
headers: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
>
|
>
|
||||||
<v-btn
|
<v-btn
|
||||||
slot="append"
|
slot="append"
|
||||||
color="#3bb9f1"
|
color="#9970ff"
|
||||||
dark
|
dark
|
||||||
@click="search"
|
@click="search"
|
||||||
>
|
>
|
||||||
@@ -96,10 +96,7 @@
|
|||||||
<th class="text-center">
|
<th class="text-center">
|
||||||
오픈 예정일
|
오픈 예정일
|
||||||
</th>
|
</th>
|
||||||
<th
|
<th class="text-center">
|
||||||
v-if="isAdmin"
|
|
||||||
class="text-center"
|
|
||||||
>
|
|
||||||
관리
|
관리
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -217,7 +214,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>{{ item.date }}</td>
|
<td>{{ item.date }}</td>
|
||||||
<td>{{ item.releaseDate }}</td>
|
<td>{{ item.releaseDate }}</td>
|
||||||
<td v-if="isAdmin">
|
<td>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-btn
|
<v-btn
|
||||||
@@ -530,14 +527,6 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
|
||||||
isAdmin() {
|
|
||||||
const role = (this.$store && this.$store.state && this.$store.state.accountStore && this.$store.state.accountStore.role)
|
|
||||||
|| (typeof localStorage !== 'undefined' ? localStorage.role : '');
|
|
||||||
return role === 'ADMIN';
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
async created() {
|
async created() {
|
||||||
this.audio_content = {
|
this.audio_content = {
|
||||||
id: null,
|
id: null,
|
||||||
@@ -550,10 +539,7 @@ export default {
|
|||||||
is_settlement_ratio_deleted: false,
|
is_settlement_ratio_deleted: false,
|
||||||
settlement_ratio: "",
|
settlement_ratio: "",
|
||||||
};
|
};
|
||||||
// ADMIN 권한일 때만 테마 리스트 조회
|
await this.getAudioContentThemeList();
|
||||||
if (this.isAdmin) {
|
|
||||||
await this.getAudioContentThemeList();
|
|
||||||
}
|
|
||||||
await this.getAudioContent();
|
await this.getAudioContent();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
>
|
>
|
||||||
<v-btn
|
<v-btn
|
||||||
slot="append"
|
slot="append"
|
||||||
color="#3bb9f1"
|
color="#9970ff"
|
||||||
dark
|
dark
|
||||||
@click="search"
|
@click="search"
|
||||||
>
|
>
|
||||||
@@ -171,7 +171,7 @@
|
|||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-row align="center">
|
<v-row align="center">
|
||||||
<v-col cols="4">
|
<v-col cols="4">
|
||||||
권한
|
사용 여부
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="8">
|
<v-col cols="8">
|
||||||
<v-radio-group
|
<v-radio-group
|
||||||
@@ -191,10 +191,6 @@
|
|||||||
value="USER"
|
value="USER"
|
||||||
label="일반회원"
|
label="일반회원"
|
||||||
/>
|
/>
|
||||||
<v-radio
|
|
||||||
value="CONTENT_MANAGER"
|
|
||||||
label="콘텐츠 관리자"
|
|
||||||
/>
|
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
</v-radio-group>
|
</v-radio-group>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -455,8 +451,6 @@ export default {
|
|||||||
this.user_type = 'CREATOR'
|
this.user_type = 'CREATOR'
|
||||||
} else if (member.userType === '에이전트') {
|
} else if (member.userType === '에이전트') {
|
||||||
this.user_type = 'AGENT'
|
this.user_type = 'AGENT'
|
||||||
} else if (member.userType === '콘텐츠 관리자') {
|
|
||||||
this.user_type = 'CONTENT_MANAGER'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.email = member.email
|
this.email = member.email
|
||||||
@@ -525,8 +519,7 @@ export default {
|
|||||||
if (
|
if (
|
||||||
(this.user_type === 'CREATOR' && this.member.userType === '크리에이터') ||
|
(this.user_type === 'CREATOR' && this.member.userType === '크리에이터') ||
|
||||||
(this.user_type === 'USER' && this.member.userType === '일반회원') ||
|
(this.user_type === 'USER' && this.member.userType === '일반회원') ||
|
||||||
(this.user_type === 'AGENT' && this.member.userType === '에이전트') ||
|
(this.user_type === 'AGENT' && this.member.userType === '에이전트')
|
||||||
(this.user_type === 'CONTENT_MANAGER' && this.member.userType === '콘텐츠 관리자')
|
|
||||||
) {
|
) {
|
||||||
this.notifyError("변경사항이 없습니다.")
|
this.notifyError("변경사항이 없습니다.")
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user