更换新接口
This commit is contained in:
@@ -43,11 +43,14 @@
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
let newsData = res.data.data
|
let newsData = res.data.data
|
||||||
console.log('新闻', newsData);
|
console.log('新闻', newsData);
|
||||||
|
if (newsData) {
|
||||||
for (const item of newsData) {
|
for (const item of newsData) {
|
||||||
item.pub_time_str = dateFormat(item.pub_time_str)
|
item.pub_time_str = dateFormat(item.pub_time_str)
|
||||||
}
|
}
|
||||||
// newsData = newsData.slice(0, 3)
|
// newsData = newsData.slice(0, 3)
|
||||||
this.newsList = newsData
|
this.newsList = newsData
|
||||||
|
}
|
||||||
|
|
||||||
}).finally(_ => {})
|
}).finally(_ => {})
|
||||||
},
|
},
|
||||||
// 跳转到新闻详情页
|
// 跳转到新闻详情页
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
pageNum: this.pageNum
|
pageNum: this.pageNum
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
let tags = res.data.data
|
let tags = res.data.data
|
||||||
|
if (tags) {
|
||||||
for (const item of tags) {
|
for (const item of tags) {
|
||||||
let tag = item.tags
|
let tag = item.tags
|
||||||
this.tagsArray = tag.split(',')
|
this.tagsArray = tag.split(',')
|
||||||
@@ -69,6 +70,8 @@
|
|||||||
this.productList = [...this.productList, ...res.data.data]
|
this.productList = [...this.productList, ...res.data.data]
|
||||||
//这用于上架时间和点赞量的数据切换
|
//这用于上架时间和点赞量的数据切换
|
||||||
// this.productList = res.data.data
|
// this.productList = res.data.data
|
||||||
|
}
|
||||||
|
|
||||||
}).finally(_ => {
|
}).finally(_ => {
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const serverHost = 'https://pupil.hchyun.com/api' // https://api-ugo-web.itheima.net'
|
const serverHost = 'https://www.foodtops.cn/api' // https://api-ugo-web.itheima.net'
|
||||||
function isOutTime(res) {
|
function isOutTime(res) {
|
||||||
if (res.data.message === '请先登录') {
|
if (res.data.message === '请先登录') {
|
||||||
uni.showToast('登录信息已过期,请重新登录')
|
uni.showToast('登录信息已过期,请重新登录')
|
||||||
|
|||||||
Reference in New Issue
Block a user