From 3077219d5b5be7829091ac12f3cc866f623988d9 Mon Sep 17 00:00:00 2001 From: zhaowenkang Date: Tue, 3 Dec 2024 21:07:53 +0800 Subject: [PATCH] =?UTF-8?q?vue=E8=B7=A8=E5=9F=9F=E7=9A=84=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C+=E4=BB=8E=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E4=B8=AD=E5=8F=96=E6=95=B0=E6=8D=AE=E5=B9=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E6=9C=89=E5=B0=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vueHomilyLink/src/api/HomeApi.js | 2 +- vueHomilyLink/src/api/index.js | 6 +- vueHomilyLink/src/views/HomeView.vue | 221 ++++++++++++++++++++++++----------- vueHomilyLink/vite.config.js | 10 ++ 4 files changed, 165 insertions(+), 74 deletions(-) diff --git a/vueHomilyLink/src/api/HomeApi.js b/vueHomilyLink/src/api/HomeApi.js index 55a665b..21e603a 100644 --- a/vueHomilyLink/src/api/HomeApi.js +++ b/vueHomilyLink/src/api/HomeApi.js @@ -6,7 +6,7 @@ const homeApi = { }, //获取视频列表 getHomeVideo(){ - return service.get('/mainpage/get-videos'); + return service.get('/mainpage/get-videos?flagType=1'); } } export default homeApi; \ No newline at end of file diff --git a/vueHomilyLink/src/api/index.js b/vueHomilyLink/src/api/index.js index a388e65..a6ba51f 100644 --- a/vueHomilyLink/src/api/index.js +++ b/vueHomilyLink/src/api/index.js @@ -1,9 +1,11 @@ import axios from "axios"; const service = axios.create({ - baseURL: 'http://localhost:8080', + // baseURL: 'http://192.168.8.191:8080', + // baseURL: 'http://localhost:8080', + baseURL: '/api', }); - +// http://192.168.8.191:8080 //Axios的响应拦截器.. service.interceptors.response.use(resp => { diff --git a/vueHomilyLink/src/views/HomeView.vue b/vueHomilyLink/src/views/HomeView.vue index 6797f11..9a7791b 100644 --- a/vueHomilyLink/src/views/HomeView.vue +++ b/vueHomilyLink/src/views/HomeView.vue @@ -1,7 +1,7 @@ @@ -59,35 +97,46 @@ onMounted(() => {
推荐
+
  • + +
    +
    + 文章图片 + +
    +
    + + club_id为1的角标 + club_id为2的角标 + club_id为3的角标 + club_id为4的角标 + +
    +
    + +
  • +
    @@ -215,17 +264,29 @@ body { display: flex; } -.corner-mark { + .corner-mark { position: absolute; top: 0; left: 0; - background-color: red; + background-color: rgb(128, 128, 128); color: white; padding: 2px 5px; border-radius: 2px; font-size: 12px; } +.color-red { + background-color: red; +} + +.color-green { + background-color: rgb(255, 102, 0); +} + +.color-blue { + background-color: rgb(255, 196, 0); +} + .play-time { position: absolute; bottom: 10%; @@ -236,4 +297,22 @@ body { border-radius: 2px; font-size: 12px; } + +.club { + position: absolute; + top: 0; + right: 0; + /* 可以根据实际需求调整容器大小等样式 */ + + width: 10px; + height: 10px; +} +.club_img img { + position: absolute; + top: 0; + right: 0; + /* 可以根据实际需求调整图片的大小等其他样式,以下是示例 */ + width: 15px; /* 假设调整宽度 */ + height: 15px; /* 假设调整高度 */ + } diff --git a/vueHomilyLink/vite.config.js b/vueHomilyLink/vite.config.js index 4217010..3f92ffb 100644 --- a/vueHomilyLink/vite.config.js +++ b/vueHomilyLink/vite.config.js @@ -15,4 +15,14 @@ export default defineConfig({ '@': fileURLToPath(new URL('./src', import.meta.url)) }, }, + server: { + proxy: { + '/api': { + // target: 'http://192.168.8.191:8080', + target: 'http://localhost:8080', + changeOrigin: true, + rewrite: (path) => path.replace(/^\/api/, '') + } + } + } })