|
@@ -150,8 +150,6 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { getMembershipStats } from '@/api/admin'
|
|
|
|
|
-
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'MembershipCenter',
|
|
name: 'MembershipCenter',
|
|
|
data() {
|
|
data() {
|
|
@@ -220,9 +218,14 @@ export default {
|
|
|
return []
|
|
return []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ async _request(url, data) {
|
|
|
|
|
+ const axios = this.$axios || (await import('axios')).default
|
|
|
|
|
+ const baseURL = process.env.VUE_APP_BASE_API || ''
|
|
|
|
|
+ return axios.post(baseURL + url, data)
|
|
|
|
|
+ },
|
|
|
async loadOverview() {
|
|
async loadOverview() {
|
|
|
try {
|
|
try {
|
|
|
- const res = await this.$axios.post('/api/admin/membership/overview')
|
|
|
|
|
|
|
+ const res = await this._request('/api/admin/membership/overview')
|
|
|
if (res.data && res.data.code === 200) {
|
|
if (res.data && res.data.code === 200) {
|
|
|
Object.assign(this.overview, res.data.data)
|
|
Object.assign(this.overview, res.data.data)
|
|
|
}
|
|
}
|
|
@@ -233,7 +236,7 @@ export default {
|
|
|
async loadLevels() {
|
|
async loadLevels() {
|
|
|
this.levelsLoading = true
|
|
this.levelsLoading = true
|
|
|
try {
|
|
try {
|
|
|
- const res = await this.$axios.post('/api/admin/membership/levels')
|
|
|
|
|
|
|
+ const res = await this._request('/api/admin/membership/levels')
|
|
|
if (res.data && res.data.code === 200) {
|
|
if (res.data && res.data.code === 200) {
|
|
|
this.levels = res.data.data || []
|
|
this.levels = res.data.data || []
|
|
|
}
|
|
}
|
|
@@ -246,7 +249,7 @@ export default {
|
|
|
async loadUpgradeRecords() {
|
|
async loadUpgradeRecords() {
|
|
|
this.recordsLoading = true
|
|
this.recordsLoading = true
|
|
|
try {
|
|
try {
|
|
|
- const res = await this.$axios.post('/api/admin/membership/upgrade-records', {
|
|
|
|
|
|
|
+ const res = await this._request('/api/admin/membership/upgrade-records', {
|
|
|
page: this.recordFilter.page,
|
|
page: this.recordFilter.page,
|
|
|
size: this.recordFilter.size
|
|
size: this.recordFilter.size
|
|
|
})
|
|
})
|