From ede163fd63f305c40433202bf456826ded66da53 Mon Sep 17 00:00:00 2001 From: timerzz Date: Tue, 14 May 2024 22:38:10 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx.conf | 10 +++ src/api/product.js | 7 ++ src/routers/index.js | 7 +- src/views/Product/index.vue | 138 ++++++++++++++++++++++++++++++++++++ src/views/layout/Aside.vue | 8 ++- vite.config.js | 2 +- 6 files changed, 169 insertions(+), 3 deletions(-) create mode 100644 src/api/product.js create mode 100644 src/views/Product/index.vue diff --git a/nginx.conf b/nginx.conf index af99248..5677ee9 100644 --- a/nginx.conf +++ b/nginx.conf @@ -24,6 +24,16 @@ server { proxy_pass http://ht-watcher:8080; } + location /api/v1/spider{ + resolver 10.43.0.10 valid=10s; # 6.6.6.6 为自建DNS + proxy_pass http://product-spider:8080; + } + + location /api/v1/products { + resolver 10.43.0.10 valid=10s; # 6.6.6.6 为自建DNS + proxy_pass http://product-backend:8080; + } + error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; diff --git a/src/api/product.js b/src/api/product.js new file mode 100644 index 0000000..8d213fa --- /dev/null +++ b/src/api/product.js @@ -0,0 +1,7 @@ +import {mande} from "mande"; + +const product = mande('/api/v1/products') + +export const ListProducts = (query) => { + return product.get({query:query}) +} \ No newline at end of file diff --git a/src/routers/index.js b/src/routers/index.js index 3e3bcf9..d724df9 100644 --- a/src/routers/index.js +++ b/src/routers/index.js @@ -10,11 +10,16 @@ const routes = [ name: 'watcher', component: ()=>import('@/views/Watcher/index.vue') }, + { + path: '/product', + name: 'product', + component: ()=>import('@/views/Product/index.vue') + }, { path: '/pusher', name: 'pusher', component: ()=>import('@/views/Pusher/index.vue') - } + }, ] const router = createRouter({ diff --git a/src/views/Product/index.vue b/src/views/Product/index.vue new file mode 100644 index 0000000..b7fd921 --- /dev/null +++ b/src/views/Product/index.vue @@ -0,0 +1,138 @@ + + + + + + \ No newline at end of file diff --git a/src/views/layout/Aside.vue b/src/views/layout/Aside.vue index 4100d45..e0a92a3 100644 --- a/src/views/layout/Aside.vue +++ b/src/views/layout/Aside.vue @@ -8,7 +8,7 @@ >