Compare commits

...

6 Commits

Author SHA1 Message Date
Yu Sung c788a9e7dd 관리자 - 추천 라이브 크리에이터 배너 API 적용 2023-08-07 03:11:47 +09:00
Yu Sung b6fcbaa11a 콘텐츠 메인 상단 배너 - 크리에이터 불러오는 API 수정 2023-08-07 01:19:53 +09:00
Yu Sung 80f819744e 라이브 관심사 - API URL 수정 2023-08-06 22:42:31 +09:00
Yu Sung fb08221aa3 캔, 충전현황 페이지 API 연동 2023-08-06 14:27:31 +09:00
Yu Sung f66bfd8524 회원 태그 - CRUD API 추가 2023-08-06 13:52:03 +09:00
Yu Sung 1d4bcd601d 회원리스트 페이지 2023-08-06 11:12:35 +09:00
24 changed files with 206 additions and 258 deletions

View File

@ -1,4 +1,4 @@
# yozm-admin
# soda-live-admin
## Project setup
```

4
package-lock.json generated
View File

@ -1,11 +1,11 @@
{
"name": "yozm-admin",
"name": "soda-live-admin",
"version": "0.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "yozm-admin",
"name": "soda-live-admin",
"version": "0.1.0",
"dependencies": {
"core-js": "^3.6.5",

View File

@ -1,5 +1,5 @@
{
"name": "yozm-admin",
"name": "soda-live-admin",
"version": "0.1.0",
"private": true,
"scripts": {

View File

@ -7,7 +7,7 @@
dark
>
<v-spacer />
<v-toolbar-title>요즘 관리자</v-toolbar-title>
<v-toolbar-title>소다라이브 관리자</v-toolbar-title>
<v-spacer />
</v-app-bar>

21
src/api/can.js Normal file
View File

@ -0,0 +1,21 @@
import Vue from 'vue';
async function deleteCan(id) {
return Vue.axios.delete('/admin/can/' + id);
}
async function getCans() {
return Vue.axios.get('/can');
}
async function insertCan(can, rewardCan, price) {
const request = {can: can, rewardCan: rewardCan, price: price}
return Vue.axios.post('/admin/can', request);
}
async function paymentCan(can, method, member_id) {
const request = {memberId: member_id, method: method, can: can}
return Vue.axios.post('/admin/can/charge', request)
}
export {getCans, insertCan, deleteCan, paymentCan}

View File

@ -1,27 +0,0 @@
import Vue from 'vue';
async function deleteCoin(id) {
return Vue.axios.delete('/coin/' + id);
}
async function modifyCoin(id, coin, rewardCoin, price) {
const request = {id: id, coin: coin, rewardCoin: rewardCoin, price: price}
return Vue.axios.put('/coin', request);
}
async function getCoins() {
return Vue.axios.get('/coin');
}
async function insertCoin(coin, rewardCoin, price) {
const request = {coin: coin, rewardCoin: rewardCoin, price: price}
return Vue.axios.post('/coin', request);
}
async function paymentCoin(coin, method, account_id) {
const request = {accountId: account_id, method: method, coin: coin}
return Vue.axios.post('/admin/coin/charge', request)
}
export {getCoins, insertCoin, modifyCoin, deleteCoin, paymentCoin}

View File

@ -1,7 +1,7 @@
import Vue from 'vue';
async function enrollment(formData) {
return Vue.axios.post('/account/counselor/tag', formData, {
return Vue.axios.post('/admin/member/tag', formData, {
headers: {
"Content-Type": "multipart/form-data",
},
@ -9,15 +9,15 @@ async function enrollment(formData) {
}
async function getTags() {
return Vue.axios.get('/account/counselor/tag');
return Vue.axios.get('/member/tag');
}
async function deleteTag(tagId) {
return Vue.axios.delete('/account/counselor/tag/' + tagId)
return Vue.axios.delete('/admin/member/tag/' + tagId)
}
async function modifyTag(tagId, formData) {
return Vue.axios.put('/account/counselor/tag/' + tagId, formData, {
return Vue.axios.put('/admin/member/tag/' + tagId, formData, {
headers: {
"Content-Type": "multipart/form-data",
},
@ -25,7 +25,7 @@ async function modifyTag(tagId, formData) {
}
async function updateTagOrders(ids) {
return Vue.axios.put('/account/counselor/tag/orders', { ids: ids })
return Vue.axios.put('/admin/member/tag/orders', { ids: ids })
}
export { enrollment, getTags, deleteTag, modifyTag, updateTagOrders }

View File

@ -1,7 +1,7 @@
import Vue from 'vue';
async function enrollment(formData) {
return Vue.axios.post('/suda/tag', formData, {
return Vue.axios.post('/live/tag', formData, {
headers: {
"Content-Type": "multipart/form-data",
},
@ -9,15 +9,15 @@ async function enrollment(formData) {
}
async function getTags() {
return Vue.axios.get('/suda/tag');
return Vue.axios.get('/live/tag');
}
async function deleteTag(tagId) {
return Vue.axios.delete('/suda/tag/' + tagId)
return Vue.axios.delete('/live/tag/' + tagId)
}
async function modifyTag(tagId, formData) {
return Vue.axios.put('/suda/tag/' + tagId, formData, {
return Vue.axios.put('/live/tag/' + tagId, formData, {
headers: {
"Content-Type": "multipart/form-data",
},
@ -25,7 +25,7 @@ async function modifyTag(tagId, formData) {
}
async function updateTagOrders(ids) {
return Vue.axios.put('/suda/tag/orders', { ids: ids })
return Vue.axios.put('/live/tag/orders', { ids: ids })
}
export { enrollment, getTags, deleteTag, modifyTag, updateTagOrders }

View File

@ -8,46 +8,51 @@ async function login(email, password) {
});
}
async function getAccountList(page) {
async function getMemberList(page) {
return Vue.axios.get(
"/admin/account/list?page=" + (page - 1) +
"/admin/member/list?page=" + (page - 1) +
"&size=20"
)
}
async function searchAccount(searchWord, page) {
async function searchMember(searchWord, page) {
return Vue.axios.get(
"/admin/account/search?search_word=" + searchWord +
"/admin/member/search?search_word=" + searchWord +
"&page=" + (page - 1) +
"&size=20"
)
}
async function getCreatorAccountList(page) {
async function getCreatorList(page) {
return Vue.axios.get(
"/admin/account/creator/list?page=" + (page - 1) +
"/admin/member/creator/list?page=" + (page - 1) +
"&size=20"
)
}
async function searchCreatorAccount(searchWord, page) {
async function searchCreator(searchWord, page) {
return Vue.axios.get(
"/admin/account/creator/search?search_word=" + searchWord +
"/admin/member/creator/search?search_word=" + searchWord +
"&page=" + (page - 1) +
"&size=20"
)
}
async function updateAccount(id, user_type) {
async function updateMember(id, user_type) {
const request = {id, userType: user_type}
return Vue.axios.put("/admin/account", request)
return Vue.axios.put("/admin/member", request)
}
async function getCreatorAllList() {
return Vue.axios.get("/admin/member/creator/all/list")
}
export {
login,
getAccountList,
searchAccount,
getCreatorAccountList,
searchCreatorAccount,
updateAccount
getMemberList,
searchMember,
getCreatorList,
searchCreator,
updateMember,
getCreatorAllList
}

View File

@ -1,27 +1,32 @@
import Vue from 'vue';
async function createRecommendSudaCreator(formData) {
return Vue.axios.post('/admin/suda/recommend-suda-creator', formData, {
async function createRecommendCreatorBanner(formData) {
return Vue.axios.post('/admin/live/recommend-creator', formData, {
headers: {
"Content-Type": "multipart/form-data",
},
});
}
async function updateRecommendSudaCreator(formData) {
return Vue.axios.put('/admin/suda/recommend-suda-creator', formData, {
async function updateRecommendCreatorBanner(formData) {
return Vue.axios.put('/admin/live/recommend-creator', formData, {
headers: {
"Content-Type": "multipart/form-data",
},
});
}
async function updateRecommendSudaCreatorOrders(firstOrders, ids) {
return Vue.axios.put('/admin/suda/recommend-suda-creator/orders', { firstOrders: firstOrders, ids: ids })
async function updateRecommendCreatorBannerOrders(firstOrders, ids) {
return Vue.axios.put('/admin/live/recommend-creator/orders', {firstOrders: firstOrders, ids: ids})
}
async function getRecommendSudaCreator(page) {
return Vue.axios.get("/admin/suda/recommend-suda-creator?page=" + (page - 1) + "&size=20");
async function getRecommendCreatorBanner(page) {
return Vue.axios.get("/admin/live/recommend-creator?page=" + (page - 1) + "&size=20");
}
export { createRecommendSudaCreator, updateRecommendSudaCreator, updateRecommendSudaCreatorOrders, getRecommendSudaCreator };
export {
createRecommendCreatorBanner,
updateRecommendCreatorBanner,
updateRecommendCreatorBannerOrders,
getRecommendCreatorBanner
};

View File

@ -28,12 +28,12 @@ const routes = [
{
path: '/member/list',
name: 'MemberList',
component: () => import(/* webpackChunkName: "member" */ '../views/Account/MemberList.vue')
component: () => import(/* webpackChunkName: "member" */ '../views/Member/MemberList')
},
{
path: '/creator/tags',
name: 'CreatorTags',
component: () => import(/* webpackChunkName: "counselor" */ '../views/Creator/CreatorTags.vue')
component: () => import(/* webpackChunkName: "counselor" */ '../views/Creator/CreatorTags')
},
{
path: '/creator/list',
@ -108,7 +108,7 @@ const routes = [
{
path: '/can/status',
name: 'CoinStatus',
component: () => import(/* webpackChunkName: "coin" */ '../views/Can/CoinStatus.vue')
component: () => import(/* webpackChunkName: "coin" */ '../views/Can/CanStatus.vue')
},
{
path: '/calculate/creator',

View File

@ -2,7 +2,7 @@
<div>
<v-toolbar dark>
<v-spacer />
<v-toolbar-title>코인 충전</v-toolbar-title>
<v-toolbar-title> 충전</v-toolbar-title>
<v-spacer />
</v-toolbar>
@ -23,8 +23,8 @@
/>
<v-text-field
v-model="coin"
label="지급할 코인 수"
v-model="can"
label="지급할 수"
outlined
required
/>
@ -39,7 +39,7 @@
depressed
@click="confirm"
>
코인 지급
지급
</v-btn>
</v-col>
</v-row>
@ -50,7 +50,7 @@
persistent
>
<v-card>
<v-card-title>코인 지급 확인</v-card-title>
<v-card-title> 지급 확인</v-card-title>
<v-card-text>
회원번호: {{ account_id }}
</v-card-text>
@ -58,7 +58,7 @@
기록내용: {{ method }}
</v-card-text>
<v-card-text>
지급할 코인 : {{ coin }}코인
지급할 : {{ can }}
</v-card-text>
<v-card-actions v-show="!isLoading">
<v-spacer />
@ -67,7 +67,7 @@
text
@click="submit"
>
코인 지급
지급
</v-btn>
<v-spacer />
<v-btn
@ -87,10 +87,10 @@
</template>
<script>
import * as api from '@/api/coin'
import * as api from '@/api/can'
export default {
name: "CoinCharge",
name: "CanCharge",
data() {
return {
@ -98,7 +98,7 @@ export default {
isLoading: false,
account_id: '',
method: '',
coin: ''
can: ''
}
},
@ -113,15 +113,15 @@ export default {
confirm() {
if (this.account_id.trim() === '' || isNaN(this.account_id)) {
return this.notifyError('코인을 지급할 회원의 회원번호를 입력하세요.')
return this.notifyError('을 지급할 회원의 회원번호를 입력하세요.')
}
if (this.method.trim() === '') {
return this.notifyError('기록할 내용을 입력하세요')
}
if (isNaN(this.coin)) {
return this.notifyError('코인은 숫자만 넣을 수 있습니다.')
if (isNaN(this.can)) {
return this.notifyError('은 숫자만 넣을 수 있습니다.')
}
if (!this.isLoading) {
@ -140,12 +140,12 @@ export default {
try {
this.show_confirm = false
const res = await api.paymentCoin(Number(this.coin), this.method, this.account_id)
const res = await api.paymentCan(Number(this.can), this.method, this.account_id)
if (res.status === 200 && res.data.success === true) {
this.notifySuccess('코인이 지급되었습니다.')
this.notifySuccess('이 지급되었습니다.')
this.account_id = ''
this.method = ''
this.coin = ''
this.can = ''
this.is_loading = false
} else {
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')

View File

@ -2,7 +2,7 @@
<div>
<v-toolbar dark>
<v-spacer />
<v-toolbar-title>코인 환율관리</v-toolbar-title>
<v-toolbar-title> 환율관리</v-toolbar-title>
<v-spacer />
</v-toolbar>
@ -27,7 +27,7 @@
v-bind="attrs"
v-on="on"
>
코인등록
등록
</v-btn>
</v-col>
</v-row>
@ -35,33 +35,26 @@
<v-col>
<v-data-table
:headers="headers"
:items="coins"
:items="cans"
class="elevation-1"
hide-default-footer
>
<template v-slot:item.price="{ item }">
{{ item.price.toLocaleString('en-US') }}
{{ item.price.toLocaleString('en-US') }}
</template>
<template v-slot:item.coin="{ item }">
{{ item.coin.toLocaleString('en-US') }}코인
<template v-slot:item.can="{ item }">
{{ item.can.toLocaleString('en-US') }}
</template>
<template v-slot:item.rewardCoin="{ item }">
{{ item.rewardCoin.toLocaleString('en-US') }}코인
<template v-slot:item.rewardCan="{ item }">
{{ item.rewardCan.toLocaleString('en-US') }}
</template>
<template v-slot:item.management="{ item }">
<v-btn
:disabled="isLoading"
@click="showModifyCoinDialog(item)"
>
수정
</v-btn>
&nbsp;&nbsp;
<v-btn
:disabled="isLoading"
@click="deleteCoin(item)"
@click="deleteCan(item)"
>
삭제
</v-btn>
@ -73,7 +66,7 @@
</template>
<v-card>
<v-card-title>코인 등록</v-card-title>
<v-card-title> 등록</v-card-title>
<v-card-text>
<v-text-field
v-model="price"
@ -83,15 +76,15 @@
</v-card-text>
<v-card-text>
<v-text-field
v-model="coin"
label="코인"
v-model="can"
label=""
required
/>
</v-card-text>
<v-card-text>
<v-text-field
v-model="reward_coin"
label="리워드 코인"
v-model="reward_can"
label="리워드 "
required
/>
</v-card-text>
@ -105,15 +98,6 @@
취소
</v-btn>
<v-btn
v-if="selected_coin !== null"
color="blue darken-1"
text
@click="modify"
>
수정
</v-btn>
<v-btn
v-else
color="blue darken-1"
text
@click="submit"
@ -128,19 +112,19 @@
</template>
<script>
import * as api from '@/api/coin'
import * as api from '@/api/can'
export default {
name: "CoinView",
name: "CanView",
data() {
return {
isLoading: false,
show_dialog: false,
selected_coin: null,
selected_can: null,
price: null,
coin: null,
reward_coin: null,
can: null,
reward_can: null,
headers: [
{
text: '원화(VAT포함)',
@ -149,16 +133,16 @@ export default {
value: 'price',
},
{
text: '충전코인',
text: '충전',
align: 'center',
sortable: false,
value: 'coin',
value: 'can',
},
{
text: '리워드코인',
text: '리워드',
align: 'center',
sortable: false,
value: 'rewardCoin',
value: 'rewardCan',
},
{
text: '관리',
@ -167,12 +151,12 @@ export default {
value: 'management'
},
],
coins: [],
cans: [],
}
},
async created() {
await this.getCoins()
await this.getCans()
},
methods: {
@ -186,26 +170,17 @@ export default {
cancel() {
this.show_dialog = false
this.coin = null
this.can = null
this.price = null
this.reward_coin = null
this.selected_coin = null
this.reward_can = null
this.selected_can = null
},
showModifyCoinDialog(item) {
this.selected_coin = item
this.price = item.price
this.coin = item.coin
this.reward_coin = item.rewardCoin
this.show_dialog = true
},
async getCoins() {
async getCans() {
this.isLoading = true
try {
let res = await api.getCoins();
this.coins = res.data.data
let res = await api.getCans();
this.cans = res.data.data
} catch (e) {
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
} finally {
@ -213,60 +188,34 @@ export default {
}
},
async deleteCoin(item) {
async deleteCan(item) {
this.isLoading = true
let res = await api.deleteCoin(item.id)
let res = await api.deleteCan(item.id)
if (res.status === 200 && res.data.success === true) {
this.notifySuccess(res.data.message || '삭제되었습니다.')
this.coins = []
await this.getCoins()
this.cans = []
await this.getCans()
} else {
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}
},
async modify() {
this.isLoading = true
try {
const res = await api.modifyCoin(this.selected_coin.id, this.coin, this.reward_coin, this.price)
if (res.status === 200 && res.data.success === true) {
this.show_dialog = false
this.coin = null
this.price = null
this.reward_coin = null
this.selected_coin = null
this.notifySuccess(res.data.message || '수정되었습니다.')
this.coins = []
await this.getCoins()
} else {
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}
} catch (e) {
this.notifyError("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
} finally {
this.isLoading = false
}
},
async submit() {
this.isLoading = true
const res = await api.insertCoin(this.coin, this.reward_coin, this.price)
const res = await api.insertCan(this.can, this.reward_can, this.price)
if (res.status === 200 && res.data.success === true) {
this.show_dialog = false
this.coin = null
this.can = null
this.price = null
this.reward_coin = null
this.selected_coin = null
this.reward_can = null
this.selected_can = null
this.notifySuccess(res.data.message || '등록되었습니다.')
this.coins = []
await this.getCoins()
this.cans = []
await this.getCans()
} else {
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}

View File

@ -2,7 +2,7 @@
<div>
<v-toolbar dark>
<v-spacer />
<v-toolbar-title>코인 충전 현황</v-toolbar-title>
<v-toolbar-title> 충전 현황</v-toolbar-title>
<v-spacer />
</v-toolbar>
@ -132,7 +132,7 @@ import * as api from "@/api/charge_status";
import datetime from 'vuejs-datetimepicker';
export default {
name: "CoinStatus",
name: "CanStatus",
components: {datetime},
data() {

View File

@ -1,13 +0,0 @@
<template>
<div>회원별 코인관리</div>
</template>
<script>
export default {
name: "CoinByUser"
}
</script>
<style scoped>
</style>

View File

@ -235,7 +235,7 @@
<script>
import Draggable from "vuedraggable";
import * as accountApi from "@/api/member";
import * as memberApi from "@/api/member";
import * as eventApi from "@/api/event";
import * as api from "@/api/audio_content"
@ -259,7 +259,7 @@ export default {
},
async created() {
await this.getCreatorList()
await this.getCreatorAllList()
await this.getEvents()
await this.getBanners()
},
@ -485,11 +485,11 @@ export default {
}
},
async getCreatorList() {
async getCreatorAllList() {
this.is_loading = true
try {
const res = await accountApi.getCounselorList()
const res = await memberApi.getCreatorAllList()
if (res.status === 200 && res.data.success === true) {
this.creators = res.data.data.map((item) => {

View File

@ -194,7 +194,7 @@ export default {
} else {
this.is_loading = true
try {
const res = await api.searchCreatorAccount(this.search_word, this.page)
const res = await api.searchCreator(this.search_word, this.page)
if (res.status === 200 && res.data.success === true) {
const data = res.data.data
@ -229,7 +229,7 @@ export default {
async getAccounts() {
this.is_loading = true
try {
const res = await api.getCreatorAccountList(this.page)
const res = await api.getCreatorList(this.page)
if (res.status === 200 && res.data.success === true) {
const data = res.data.data

View File

@ -135,11 +135,11 @@
</template>
<script>
import * as api from "@/api/counselor_tag";
import * as api from "@/api/creator_tag";
import Draggable from "vuedraggable";
export default {
name: "CounselorTags",
name: "CreatorTags",
components: {Draggable},

View File

@ -194,7 +194,7 @@
<script>
import * as api from "@/api/explorer"
import * as creatorTagApi from "@/api/counselor_tag";
import * as creatorTagApi from "@/api/creator_tag";
import Draggable from "vuedraggable";
export default {

View File

@ -2,7 +2,7 @@
<div>
<v-toolbar dark>
<v-spacer />
<v-toolbar-title>추천 요즘라이브</v-toolbar-title>
<v-toolbar-title>추천 라이브 크리에이터</v-toolbar-title>
<v-spacer />
</v-toolbar>
@ -19,7 +19,7 @@
depressed
@click="showWriteDialog"
>
추천 요즘라이브 등록
추천 라이브 크리에이터 등록
</v-btn>
</v-col>
</v-row>
@ -29,7 +29,7 @@
<v-data-table
:headers="headers"
:items="recommendLiveList"
:loading="isLoading"
:loading="is_loading"
:items-per-page="20"
item-key="id"
class="elevation-1"
@ -53,7 +53,7 @@
width="100"
>
</td>
<td> <h3>{{ item.creatorNickname }}</h3> </td>
<td><h3>{{ item.creatorNickname }}</h3></td>
<td>
<h3>
{{ item.startDate }} ~ {{ item.endDate }}
@ -69,7 +69,7 @@
</td>
<td>
<v-btn
:disabled="isLoading"
:disabled="is_loading"
@click="showModifyDialog(item)"
>
수정
@ -100,11 +100,11 @@
persistent
>
<v-card>
<v-card-title>추천 요즘라이브 등록</v-card-title>
<v-card-title>추천 라이브 크리에이터 등록</v-card-title>
<v-card-text>
<v-row align="center">
<v-col cols="4">
요즘친구
크리에이터
</v-col>
<v-col cols="8">
<v-select
@ -131,7 +131,7 @@
class="datepicker"
format="YYYY-MM-DD H:i"
/>
<div> ~ </div>
<div> ~</div>
<datetime
v-model="end_date"
class="datepicker"
@ -178,7 +178,7 @@
</v-col>
</v-row>
</v-card-text>
<v-card-actions v-show="!isLoading">
<v-card-actions v-show="!is_loading">
<v-spacer />
<v-btn
color="blue darken-1"
@ -213,15 +213,15 @@
<script>
import Draggable from 'vuedraggable';
import datetime from 'vuejs-datetimepicker';
import * as accountApi from "@/api/member";
import * as memberApi from "@/api/member";
import * as api from "@/api/recommend_suda_creator"
export default {
name: "LiveRecommendView",
components: { datetime, Draggable },
components: {datetime, Draggable},
data() {
return {
isLoading: false,
is_loading: false,
page: 1,
total_page: 0,
show_write_dialog: false,
@ -242,7 +242,7 @@ export default {
value: 'image',
},
{
text: '요즘친구',
text: '크리에이터',
align: 'center',
sortable: false,
value: 'creatorNickname',
@ -271,7 +271,7 @@ export default {
async created() {
await this.getCreatorList()
await this.getRecommendSudaCreator()
await this.getRecommendCreator()
},
methods: {
@ -284,7 +284,7 @@ export default {
const firstOrders = (this.page - 1) * 20 + 1
const res = await api.updateRecommendSudaCreatorOrders(firstOrders, ids)
const res = await api.updateRecommendCreatorBannerOrders(firstOrders, ids)
if (res.status === 200 && res.data.success === true) {
this.notifySuccess(res.data.message)
}
@ -306,7 +306,7 @@ export default {
try {
const formData = new FormData()
formData.append("recommend_suda_creator_id", this.selected_recommend_live.id)
formData.append("recommend_creator_banner_id", this.selected_recommend_live.id)
if (this.image !== null) {
formData.append("image", this.image)
@ -328,12 +328,12 @@ export default {
formData.append("is_adult", this.is_adult)
}
const res = await api.updateRecommendSudaCreator(formData)
const res = await api.updateRecommendCreatorBanner(formData)
if (res.status === 200 && res.data.success === true) {
this.cancel()
this.notifySuccess('수정되었습니다.')
this.page = 1
await this.getRecommendSudaCreator()
await this.getRecommendCreator()
} else {
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
this.is_loading = false
@ -349,7 +349,7 @@ export default {
async submit() {
if (this.is_loading) return;
this.isLoading = true
this.is_loading = true
try {
const formData = new FormData()
@ -359,13 +359,14 @@ export default {
formData.append("end_date", this.end_date)
formData.append("is_adult", this.is_adult)
const res = await api.createRecommendSudaCreator(formData);
const res = await api.createRecommendCreatorBanner(formData);
if (res.status === 200 && res.data.success === true) {
this.cancel()
this.notifySuccess('등록되었습니다.')
this.page = 1
await this.getRecommendSudaCreator()
await this.getRecommendCreator()
} else {
this.is_loading = false
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
this.is_loading = false
}
@ -408,14 +409,14 @@ export default {
},
async next() {
await this.getRecommendSudaCreator()
await this.getRecommendCreator()
},
async getRecommendSudaCreator() {
this.isLoading = true
async getRecommendCreator() {
this.is_loading = true
try {
const res = await api.getRecommendSudaCreator(this.page)
const res = await api.getRecommendCreatorBanner(this.page)
if (res.status === 200 && res.data.success === true) {
const data = res.data.data
@ -435,15 +436,15 @@ export default {
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
this.is_loading = false
} finally {
this.isLoading = false
this.is_loading = false
}
},
async getCreatorList() {
this.isLoading = true
this.is_loading = true
try {
const res = await accountApi.getCounselorList()
const res = await memberApi.getCreatorAllList()
if (res.status === 200 && res.data.success === true) {
this.creatorList = res.data.data.map((item) => {
@ -457,7 +458,7 @@ export default {
this.notifyError('알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
this.is_loading = false
} finally {
this.isLoading = false
this.is_loading = false
}
},
imageAdd(payload) {

View File

@ -78,7 +78,12 @@
</template>
<v-card>
<v-card-title>관심사 등록</v-card-title>
<v-card-title v-if="selected_tag !== null">
관심사 수정
</v-card-title>
<v-card-title v-else>
관심사 등록
</v-card-title>
<v-card-text>
<v-text-field
v-model="tag_text"
@ -194,6 +199,7 @@ export default {
this.image = null
this.image_url = null
this.tag_text = null
this.selected_tag = null
},
showModifyTagDialog(tag) {
@ -269,6 +275,7 @@ export default {
if (res.status === 200 && res.data.success === true) {
this.show_dialog = false
this.selected_tag = null
this.image = null
this.image_url = null
this.tag_text = null

View File

@ -68,7 +68,7 @@
</thead>
<tbody>
<tr
v-for="item in accounts"
v-for="item in memberList"
:key="item.id"
>
<td>{{ item.id }}</td>
@ -206,7 +206,7 @@
import * as api from '@/api/member'
export default {
name: "AccountList",
name: "MemberList",
data() {
return {
@ -214,8 +214,8 @@ export default {
page: 1,
total_page: 0,
search_word: '',
accounts: [],
account: null,
memberList: [],
member: null,
email: null,
nickname: null,
user_type: null,
@ -224,7 +224,7 @@ export default {
},
async created() {
await this.getAccounts()
await this.getMemberList()
},
methods: {
@ -238,23 +238,23 @@ export default {
async search() {
this.page = 1
await this.searchAccount()
await this.searchMember()
},
async searchAccount() {
async searchMember() {
if (this.search_word.length === 0) {
await this.getAccounts()
await this.getMemberList()
} else if (this.search_word.length < 2) {
this.notifyError('검색어를 2글자 이상 입력하세요.')
} else {
this.is_loading = true
try {
const res = await api.searchAccount(this.search_word, this.page)
const res = await api.searchMember(this.search_word, this.page)
if (res.status === 200 && res.data.success === true) {
const data = res.data.data
const total_page = Math.ceil(data.totalCount / 20)
this.accounts = data.items
this.memberList = data.items
if (total_page <= 0)
this.total_page = 1
@ -275,21 +275,21 @@ export default {
async next() {
if (this.search_word.length < 2) {
this.search_word = ''
await this.getAccounts()
await this.getMemberList()
} else {
await this.searchAccount()
await this.searchMember()
}
},
async getAccounts() {
async getMemberList() {
this.is_loading = true
try {
const res = await api.getAccountList(this.page)
const res = await api.getMemberList(this.page)
if (res.status === 200 && res.data.success === true) {
const data = res.data.data
const total_page = Math.ceil(data.totalCount / 20)
this.accounts = data.items
this.memberList = data.items
if (total_page <= 0)
this.total_page = 1
@ -306,23 +306,23 @@ export default {
}
},
showPopupDialog(account) {
this.account = account
showPopupDialog(member) {
this.member = member
if (account.userType === '일반회원') {
if (member.userType === '일반회원') {
this.user_type = 'USER'
} else if (account.userType === '요즘친구') {
} else if (member.userType === '요즘친구') {
this.user_type = 'CREATOR'
}
this.email = account.email
this.nickname = account.nickname
this.email = member.email
this.nickname = member.nickname
this.show_popup_dialog = true
},
cancel() {
this.account = null
this.member = null
this.email = null
this.nickname = null
this.user_type = null
@ -333,20 +333,20 @@ export default {
this.is_loading = true
if (
(this.user_type === 'CREATOR' && this.account.userType === '요즘친구') ||
(this.user_type === 'USER' && this.account.userType === '일반회원')
(this.user_type === 'CREATOR' && this.member.userType === '요즘친구') ||
(this.user_type === 'USER' && this.member.userType === '일반회원')
) {
this.notifyError("변경사항이 없습니다.")
} else {
try {
const res = await api.updateAccount(this.account.id, this.user_type)
const res = await api.updateMember(this.member.id, this.user_type)
if (res.status === 200 && res.data.success === true) {
this.page = 1
this.total_page = 0
this.search_word = ''
this.accounts = []
await this.getAccounts()
this.memberList = []
await this.getMemberList()
} else {
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
}