회원리스트 페이지
This commit is contained in:
parent
c60930a566
commit
1d4bcd601d
|
@ -8,16 +8,16 @@ async function login(email, password) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getAccountList(page) {
|
async function getMemberList(page) {
|
||||||
return Vue.axios.get(
|
return Vue.axios.get(
|
||||||
"/admin/account/list?page=" + (page - 1) +
|
"/admin/member/list?page=" + (page - 1) +
|
||||||
"&size=20"
|
"&size=20"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function searchAccount(searchWord, page) {
|
async function searchMember(searchWord, page) {
|
||||||
return Vue.axios.get(
|
return Vue.axios.get(
|
||||||
"/admin/account/search?search_word=" + searchWord +
|
"/admin/member/search?search_word=" + searchWord +
|
||||||
"&page=" + (page - 1) +
|
"&page=" + (page - 1) +
|
||||||
"&size=20"
|
"&size=20"
|
||||||
)
|
)
|
||||||
|
@ -25,29 +25,29 @@ async function searchAccount(searchWord, page) {
|
||||||
|
|
||||||
async function getCreatorAccountList(page) {
|
async function getCreatorAccountList(page) {
|
||||||
return Vue.axios.get(
|
return Vue.axios.get(
|
||||||
"/admin/account/creator/list?page=" + (page - 1) +
|
"/admin/member/creator/list?page=" + (page - 1) +
|
||||||
"&size=20"
|
"&size=20"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function searchCreatorAccount(searchWord, page) {
|
async function searchCreatorAccount(searchWord, page) {
|
||||||
return Vue.axios.get(
|
return Vue.axios.get(
|
||||||
"/admin/account/creator/search?search_word=" + searchWord +
|
"/admin/member/creator/search?search_word=" + searchWord +
|
||||||
"&page=" + (page - 1) +
|
"&page=" + (page - 1) +
|
||||||
"&size=20"
|
"&size=20"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function updateAccount(id, user_type) {
|
async function updateMember(id, user_type) {
|
||||||
const request = {id, userType: user_type}
|
const request = {id, userType: user_type}
|
||||||
return Vue.axios.put("/admin/account", request)
|
return Vue.axios.put("/admin/member", request)
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
login,
|
login,
|
||||||
getAccountList,
|
getMemberList,
|
||||||
searchAccount,
|
searchMember,
|
||||||
getCreatorAccountList,
|
getCreatorAccountList,
|
||||||
searchCreatorAccount,
|
searchCreatorAccount,
|
||||||
updateAccount
|
updateMember
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ const routes = [
|
||||||
{
|
{
|
||||||
path: '/member/list',
|
path: '/member/list',
|
||||||
name: 'MemberList',
|
name: 'MemberList',
|
||||||
component: () => import(/* webpackChunkName: "member" */ '../views/Account/MemberList.vue')
|
component: () => import(/* webpackChunkName: "member" */ '../views/Member/./MemberList')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/creator/tags',
|
path: '/creator/tags',
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr
|
<tr
|
||||||
v-for="item in accounts"
|
v-for="item in memberList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
>
|
>
|
||||||
<td>{{ item.id }}</td>
|
<td>{{ item.id }}</td>
|
||||||
|
@ -206,7 +206,7 @@
|
||||||
import * as api from '@/api/member'
|
import * as api from '@/api/member'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AccountList",
|
name: "MemberList",
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -214,8 +214,8 @@ export default {
|
||||||
page: 1,
|
page: 1,
|
||||||
total_page: 0,
|
total_page: 0,
|
||||||
search_word: '',
|
search_word: '',
|
||||||
accounts: [],
|
memberList: [],
|
||||||
account: null,
|
member: null,
|
||||||
email: null,
|
email: null,
|
||||||
nickname: null,
|
nickname: null,
|
||||||
user_type: null,
|
user_type: null,
|
||||||
|
@ -224,7 +224,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async created() {
|
async created() {
|
||||||
await this.getAccounts()
|
await this.getMemberList()
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -238,23 +238,23 @@ export default {
|
||||||
|
|
||||||
async search() {
|
async search() {
|
||||||
this.page = 1
|
this.page = 1
|
||||||
await this.searchAccount()
|
await this.searchMember()
|
||||||
},
|
},
|
||||||
|
|
||||||
async searchAccount() {
|
async searchMember() {
|
||||||
if (this.search_word.length === 0) {
|
if (this.search_word.length === 0) {
|
||||||
await this.getAccounts()
|
await this.getMemberList()
|
||||||
} else if (this.search_word.length < 2) {
|
} else if (this.search_word.length < 2) {
|
||||||
this.notifyError('검색어를 2글자 이상 입력하세요.')
|
this.notifyError('검색어를 2글자 이상 입력하세요.')
|
||||||
} else {
|
} else {
|
||||||
this.is_loading = true
|
this.is_loading = true
|
||||||
try {
|
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) {
|
if (res.status === 200 && res.data.success === true) {
|
||||||
const data = res.data.data
|
const data = res.data.data
|
||||||
|
|
||||||
const total_page = Math.ceil(data.totalCount / 20)
|
const total_page = Math.ceil(data.totalCount / 20)
|
||||||
this.accounts = data.items
|
this.memberList = data.items
|
||||||
|
|
||||||
if (total_page <= 0)
|
if (total_page <= 0)
|
||||||
this.total_page = 1
|
this.total_page = 1
|
||||||
|
@ -275,21 +275,21 @@ export default {
|
||||||
async next() {
|
async next() {
|
||||||
if (this.search_word.length < 2) {
|
if (this.search_word.length < 2) {
|
||||||
this.search_word = ''
|
this.search_word = ''
|
||||||
await this.getAccounts()
|
await this.getMemberList()
|
||||||
} else {
|
} else {
|
||||||
await this.searchAccount()
|
await this.searchMember()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async getAccounts() {
|
async getMemberList() {
|
||||||
this.is_loading = true
|
this.is_loading = true
|
||||||
try {
|
try {
|
||||||
const res = await api.getAccountList(this.page)
|
const res = await api.getMemberList(this.page)
|
||||||
if (res.status === 200 && res.data.success === true) {
|
if (res.status === 200 && res.data.success === true) {
|
||||||
const data = res.data.data
|
const data = res.data.data
|
||||||
|
|
||||||
const total_page = Math.ceil(data.totalCount / 20)
|
const total_page = Math.ceil(data.totalCount / 20)
|
||||||
this.accounts = data.items
|
this.memberList = data.items
|
||||||
|
|
||||||
if (total_page <= 0)
|
if (total_page <= 0)
|
||||||
this.total_page = 1
|
this.total_page = 1
|
||||||
|
@ -306,23 +306,23 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
showPopupDialog(account) {
|
showPopupDialog(member) {
|
||||||
this.account = account
|
this.member = member
|
||||||
|
|
||||||
if (account.userType === '일반회원') {
|
if (member.userType === '일반회원') {
|
||||||
this.user_type = 'USER'
|
this.user_type = 'USER'
|
||||||
} else if (account.userType === '요즘친구') {
|
} else if (member.userType === '요즘친구') {
|
||||||
this.user_type = 'CREATOR'
|
this.user_type = 'CREATOR'
|
||||||
}
|
}
|
||||||
|
|
||||||
this.email = account.email
|
this.email = member.email
|
||||||
this.nickname = account.nickname
|
this.nickname = member.nickname
|
||||||
|
|
||||||
this.show_popup_dialog = true
|
this.show_popup_dialog = true
|
||||||
},
|
},
|
||||||
|
|
||||||
cancel() {
|
cancel() {
|
||||||
this.account = null
|
this.member = null
|
||||||
this.email = null
|
this.email = null
|
||||||
this.nickname = null
|
this.nickname = null
|
||||||
this.user_type = null
|
this.user_type = null
|
||||||
|
@ -333,20 +333,20 @@ export default {
|
||||||
this.is_loading = true
|
this.is_loading = true
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(this.user_type === 'CREATOR' && this.account.userType === '요즘친구') ||
|
(this.user_type === 'CREATOR' && this.member.userType === '요즘친구') ||
|
||||||
(this.user_type === 'USER' && this.account.userType === '일반회원')
|
(this.user_type === 'USER' && this.member.userType === '일반회원')
|
||||||
) {
|
) {
|
||||||
this.notifyError("변경사항이 없습니다.")
|
this.notifyError("변경사항이 없습니다.")
|
||||||
} else {
|
} else {
|
||||||
try {
|
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) {
|
if (res.status === 200 && res.data.success === true) {
|
||||||
this.page = 1
|
this.page = 1
|
||||||
this.total_page = 0
|
this.total_page = 0
|
||||||
this.search_word = ''
|
this.search_word = ''
|
||||||
|
|
||||||
this.accounts = []
|
this.memberList = []
|
||||||
await this.getAccounts()
|
await this.getMemberList()
|
||||||
} else {
|
} else {
|
||||||
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
this.notifyError(res.data.message || '알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.')
|
||||||
}
|
}
|
Loading…
Reference in New Issue