Commit 169f88f2 authored by Damon's avatar Damon

refactor: http

parent 08c6a60b
......@@ -78,6 +78,10 @@ let learnApiFun = function(vm) {
// 学员获取自己的题库
let getMyQuestionWarehouseList = async (params = {}) =>
await vm.$u.get('/rest/question/query/getMyQuestionWarehouseList', params)
let searchQuestion = async (params = {}) =>
await vm.$u.get(`/rest/question/searchQuestion/${params.questionWarehouseId}`, params)
const learnApi = {
getQuestion,
getQuestionTotal,
......@@ -97,6 +101,7 @@ let learnApiFun = function(vm) {
queryExamRecord,
queryExamRecordOne,
getMyQuestionWarehouseList,
searchQuestion
}
return learnApi
}
......
......@@ -55,7 +55,7 @@ const install = (Vue, vm) => {
} else {
// 如果返回false,则会调用Promise的reject回调,
vm.$u.toast(data.msg)
return data.data
return data
}
} else if (res.statusCode === 401) {
// 登录过期
......
......@@ -213,6 +213,7 @@ export default {
},
onLoad(e) {
this.keyword = e ? decodeURIComponent(e.keyword) : ''
this.init()
},
computed: {
defaultImg() {
......@@ -220,6 +221,15 @@ export default {
},
},
methods: {
init() {
const data = {
questionWarehouseId: this.questionWarehouseId,
keyWord: this.keyword
}
this.$u.api.searchQuestion(data).then(res => {
console.log("res", res)
})
},
itemChange(e) {
this.arrIndex = e.show ? e.index : null
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment