修改自定义题库的请求方式

This commit is contained in:
zhl 2021-05-31 19:42:46 +08:00
parent b54d4ec5f0
commit c9604e7130
2 changed files with 5 additions and 7 deletions

View File

@ -1,10 +1,10 @@
import request from '@/utils/request'
export const getShopQuestions = (params: any) =>
export const getShopQuestions = (data: any) =>
request({
url: `/api/${params.shop}/puzzles`,
url: `/api/${data.shop}/puzzles`,
method: 'post',
params
data
})
export const getShopQuestion = (shop: string, id: string, params: any) =>

View File

@ -308,6 +308,7 @@ export default class extends Vue {
private async getList() {
this.listLoading = true
console.log(this.listQuery)
const { data } = await getShopQuestions(this.listQuery)
this.listLoading = false
this.list = data.records
@ -336,10 +337,7 @@ export default class extends Vue {
private filterData() {
this.listQuery.key = this.filterForm.key
if (this.filterForm.typeSelect.length > 0) {
this.listQuery.tag = this.filterForm.typeSelect[0]
}
if (this.filterForm.typeSelect.length > 1) {
this.listQuery.sub_tag = this.filterForm.typeSelect[1]
this.listQuery.groups = this.filterForm.typeSelect
}
this.listQuery.page = 1
this.getList()