|
@@ -25,6 +25,7 @@ class SearchHistoryBaseApi {
|
|
|
|
|
|
async runQuery(params) {
|
|
|
this.searchHistoryList = []
|
|
|
+ this.browseHistoryList = []
|
|
|
const query = Object.assign({}, params, this._getParams(params))
|
|
|
const result = await this.ajaxQuery(query)
|
|
|
if (result.success) {
|
|
@@ -41,7 +42,22 @@ class SearchHistoryBaseApi {
|
|
|
async ajaxQuery(params) {
|
|
|
return ajaxGetSearchHistory(params).then((res) => {
|
|
|
let success = res?.error_code === 0
|
|
|
-
|
|
|
+ if (res?.data?.browse) {
|
|
|
+ // 格式化浏览历史数据(企业画像浏览记录跳转需要企业id, 存历史记录的时候保存格式为“企业名称_企业id”)
|
|
|
+ res.data.browse = res.data.browse.map((item) => {
|
|
|
+ if (item.indexOf('_') > -1) {
|
|
|
+ const [name, id] = item.split('_')
|
|
|
+ return {
|
|
|
+ name,
|
|
|
+ id
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ name: item
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
return {
|
|
|
success: success,
|
|
|
search: res?.data?.search ? res.data.search.reverse() : [],
|