Commit 169f88f2 authored by Damon's avatar Damon

refactor: http

parent 08c6a60b
...@@ -78,6 +78,10 @@ let learnApiFun = function(vm) { ...@@ -78,6 +78,10 @@ let learnApiFun = function(vm) {
// 学员获取自己的题库 // 学员获取自己的题库
let getMyQuestionWarehouseList = async (params = {}) => let getMyQuestionWarehouseList = async (params = {}) =>
await vm.$u.get('/rest/question/query/getMyQuestionWarehouseList', 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 = { const learnApi = {
getQuestion, getQuestion,
getQuestionTotal, getQuestionTotal,
...@@ -97,6 +101,7 @@ let learnApiFun = function(vm) { ...@@ -97,6 +101,7 @@ let learnApiFun = function(vm) {
queryExamRecord, queryExamRecord,
queryExamRecordOne, queryExamRecordOne,
getMyQuestionWarehouseList, getMyQuestionWarehouseList,
searchQuestion
} }
return learnApi return learnApi
} }
......
...@@ -55,7 +55,7 @@ const install = (Vue, vm) => { ...@@ -55,7 +55,7 @@ const install = (Vue, vm) => {
} else { } else {
// 如果返回false,则会调用Promise的reject回调, // 如果返回false,则会调用Promise的reject回调,
vm.$u.toast(data.msg) vm.$u.toast(data.msg)
return data.data return data
} }
} else if (res.statusCode === 401) { } else if (res.statusCode === 401) {
// 登录过期 // 登录过期
......
...@@ -213,6 +213,7 @@ export default { ...@@ -213,6 +213,7 @@ export default {
}, },
onLoad(e) { onLoad(e) {
this.keyword = e ? decodeURIComponent(e.keyword) : '' this.keyword = e ? decodeURIComponent(e.keyword) : ''
this.init()
}, },
computed: { computed: {
defaultImg() { defaultImg() {
...@@ -220,6 +221,15 @@ export default { ...@@ -220,6 +221,15 @@ export default {
}, },
}, },
methods: { methods: {
init() {
const data = {
questionWarehouseId: this.questionWarehouseId,
keyWord: this.keyword
}
this.$u.api.searchQuestion(data).then(res => {
console.log("res", res)
})
},
itemChange(e) { itemChange(e) {
this.arrIndex = e.show ? e.index : null 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