feat: 添加行业资讯模块及相关功能
新增行业资讯列表页和详情页,实现文章数据的获取和展示功能 添加导航菜单项到所有页面,并移除部分冗余代码 创建HTTP请求工具函数用于获取文章数据
This commit is contained in:
22
js/http.js
Normal file
22
js/http.js
Normal file
@@ -0,0 +1,22 @@
|
||||
// 获取咨询列表
|
||||
async function getArticleList(params) {
|
||||
const urlParams = new URLSearchParams(params)
|
||||
return fetch(`http://49.232.154.205/prod-api/export/article/list?${urlParams.toString()}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => res.json())
|
||||
}
|
||||
|
||||
// 获取咨询详情
|
||||
async function getArticleDetail(id) {
|
||||
return fetch(`http://49.232.154.205/prod-api/export/article/${id}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
.then(res => res.json())
|
||||
}
|
||||
Reference in New Issue
Block a user