From 5535867b741dab7c91789ff8c98032d1aa5ffaa8 Mon Sep 17 00:00:00 2001 From: "L. Jiang" Date: Mon, 7 Nov 2022 11:46:37 +0800 Subject: [PATCH] fix: Can't display the home page application list Log: Fix can't display the home page application list Issue: Fixes #2 --- .env.local | 4 ++-- Dockerfile | 8 +++++--- src/components/Main.vue | 13 +++++++------ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.env.local b/.env.local index 810fa17..6868412 100644 --- a/.env.local +++ b/.env.local @@ -1,4 +1,4 @@ #.env.local NODE_ENV=local -VUE_APP_AXIOS_BASEURL=http://10.20.52.86:8888 -VUE_APP_HOME_PAGE_URL=http://localhost +VUE_APP_AXIOS_BASEURL=http://127.0.0.1:9810 +VUE_APP_HOME_PAGE_URL=http://127.0.0.1:8080 diff --git a/Dockerfile b/Dockerfile index be75de1..19f9fb7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,11 @@ # SPDX-License-Identifier: LGPL-3.0-or-later FROM hub.deepin.com/library/node:16 AS builder -WORKDIR /linglong-web-store +WORKDIR /src COPY . . -RUN yarn --registry=http://registry-npm.sndu.cn/ install && yarn build +RUN set -eux; \ + yarn install; \ + yarn build FROM hub.deepin.com/library/nginx:latest -COPY --from=builder /linglong-web-store/dist/ /usr/share/nginx/html \ No newline at end of file +COPY --from=builder /src/dist/ /usr/share/nginx/html \ No newline at end of file diff --git a/src/components/Main.vue b/src/components/Main.vue index 3859ad7..c3820aa 100644 --- a/src/components/Main.vue +++ b/src/components/Main.vue @@ -9,8 +9,7 @@
- - +
@@ -49,16 +48,18 @@ export default defineComponent({ const appList = ref([]) const dataLoadingFlag = ref() const total = ref() - const size = 20 + const size = 24 const service = axios.create({ baseURL: process.env.VUE_APP_AXIOS_BASEURL, // url = base url + request url timeout: 10000, // request timeout }) const getList = (pageIndex = 1, pageSize = size) => { dataLoadingFlag.value = true - service.post('/apps/webstore', { - pageSize, // 参数 firstName - page:pageIndex, // 参数 lastName + service.get(`/api/v0/web-store/apps`, { + params: { + page: pageIndex, + size: pageSize, + } }).then(function (response) { appList.value = response.data.data.list total.value = response.data.data.total