diff --git a/utils/kongfz.js b/utils/kongfz.js index 23d8acf..b1bd627 100644 --- a/utils/kongfz.js +++ b/utils/kongfz.js @@ -84,17 +84,21 @@ export function login(username, password) { * @returns {Promise<{newCount: number, oldCount: number, totalFound: number}>} */ export function searchFacet(keyword, options = {}) { - const { phpsessid = '', userArea = '1006000000', dataType = 0 } = options + const { phpsessid = '', userArea = '1006000000', dataType = 0, quality = '' } = options return new Promise((resolve, reject) => { + var reqData = { + dataType: dataType, + keyword: keyword, + page: 1, + userArea: userArea + } + if (quality) { + reqData.quality = quality + } uni.request({ url: 'https://search.kongfz.com/pc-gw/search-web/client/pc/product/keyword/normal/facet', method: 'GET', - data: { - dataType: dataType, - keyword: keyword, - page: 1, - userArea: userArea - }, + data: reqData, header: { 'Cookie': phpsessid ? `PHPSESSID=${phpsessid}` : '' },