diff --git a/router/home.js b/router/home.js index e1029ed..a892546 100644 --- a/router/home.js +++ b/router/home.js @@ -7,18 +7,10 @@ const router = express.Router(); // 获取首页banner图 // http://192.168.31.101:9940/v1/api/home/banner router.get('/banner', async (req, res) => { - let $ = await Util.get(`${Config.baseUrl}/?orderby=rand`) - let result = [ - { src: 'https://image.baidu.com/search/down?thumburl=https://baidu.com&url=https://imgsa.baidu.com/forum/pic/item/54e736d12f2eb938b7ce5c2990628535e4dd6f4d.jpg' }, - { src: 'https://image.baidu.com/search/down?thumburl=https://baidu.com&url=https://imgsa.baidu.com/forum/pic/item/b899a9014c086e06d533199047087bf40bd1cb56.jpg' }, - { src: 'https://image.baidu.com/search/down?thumburl=https://baidu.com&url=https://imgsa.baidu.com/forum/pic/item/269759ee3d6d55fb6c5d50fd28224f4a21a4dd56.jpg' }, - ] - + // let $ = await Util.get(`${Config.baseUrl}/?orderby=rand`) // $(".new-swiper .swiper-wrapper .swiper-slide").each(function() { // let src = $(this).find("span img").attr("src") - // console.log("src: ", src); - // if (src) { // result.push({ src }) // } @@ -27,7 +19,11 @@ router.get('/banner', async (req, res) => { res.json({ status: 200, copyright: `bmy ${new Date()}`, - data: result + data: [ + { src: 'https://image.baidu.com/search/down?thumburl=https://baidu.com&url=https://imgsa.baidu.com/forum/pic/item/54e736d12f2eb938b7ce5c2990628535e4dd6f4d.jpg' }, + { src: 'https://image.baidu.com/search/down?thumburl=https://baidu.com&url=https://imgsa.baidu.com/forum/pic/item/b899a9014c086e06d533199047087bf40bd1cb56.jpg' }, + { src: 'https://image.baidu.com/search/down?thumburl=https://baidu.com&url=https://imgsa.baidu.com/forum/pic/item/269759ee3d6d55fb6c5d50fd28224f4a21a4dd56.jpg' }, + ] }) })