diff --git a/utils/kongfz.js b/utils/kongfz.js index b1bd627..f2d6042 100644 --- a/utils/kongfz.js +++ b/utils/kongfz.js @@ -84,7 +84,7 @@ export function login(username, password) { * @returns {Promise<{newCount: number, oldCount: number, totalFound: number}>} */ export function searchFacet(keyword, options = {}) { - const { phpsessid = '', userArea = '1006000000', dataType = 0, quality = '' } = options + const { phpsessid = '', userArea = '1006000000', dataType = 0, quality = '', author = '', publisher = '' } = options return new Promise((resolve, reject) => { var reqData = { dataType: dataType, @@ -92,8 +92,21 @@ export function searchFacet(keyword, options = {}) { page: 1, userArea: userArea } + var actionPathParts = [] if (quality) { reqData.quality = quality + actionPathParts.push('quality') + } + if (author) { + reqData.author = author + actionPathParts.push('author') + } + if (publisher) { + reqData.press = publisher + actionPathParts.push('press') + } + if (actionPathParts.length > 0) { + reqData.actionPath = actionPathParts.join(',') } uni.request({ url: 'https://search.kongfz.com/pc-gw/search-web/client/pc/product/keyword/normal/facet',