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 @@
+
+
+
+
+
+
+
+
+ {{record.name}}
+ 正在抓取信息
+
+
+ {{moment(record.updatedAt).format('YYYY-MM-DD HH:mm:ss')}}
+
+
+
+
+
+
+
+ {{record.calMark}}
+
+ {{parseFloat(record.cnyPrice).toFixed(2)}}
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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 @@
>