diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 index 40eadb1..502352b --- a/build.sh +++ b/build.sh @@ -1,11 +1,14 @@ #!/bin/bash # 配置统计key -export VUE_APP_QIEZI_HOST = "https://fleyx.com"; -export VUE_APP_QIEZI_KEY = "aab3cad381f54ca5b7b9abeb2e09320a"; +export VUE_APP_QIEZI_HOST="https://fleyx.com"; +export VUE_APP_QIEZI_KEY="aab3cad381f54ca5b7b9abeb2e09320a"; base=$(cd "$(dirname "$0")";pwd) +echo $VUE_APP_QIEZI_HOST +echo $VUE_APP_QIEZI_KEY +# # 前端打包 -docker run -it --rm --user ${UID} -v $base/qiezi_front:/opt/front node:lts-buster-slim bash -c "cd /opt/front && yarn --registry https://registry.npm.taobao.org && yarn build" +docker run -it --rm --user ${UID} -e VUE_APP_QIEZI_HOST=${VUE_APP_QIEZI_HOST} -e VUE_APP_QIEZI_KEY=${VUE_APP_QIEZI_KEY} -v $base/qiezi_front:/opt/front node:lts-buster-slim bash -c "cd /opt/front && yarn --registry https://registry.npm.taobao.org && yarn build" # 后端打包 docker run -it --rm --user ${UID} -v $base/data/maven/mavenRep:/var/maven/.m2: -v $base/data/maven/settings.xml:/usr/share/maven/conf/settings.xml -v $base/qieziBackend:/code maven:3-openjdk-11-slim bash -c "cd /code && mvn clean install" diff --git a/data/nginx/nginx.conf b/data/nginx/nginx.conf index 0c1ad40..27451cc 100644 --- a/data/nginx/nginx.conf +++ b/data/nginx/nginx.conf @@ -28,11 +28,16 @@ http { listen 8080; listen [::]:8080; index index.html; - root /opt/dist/; server_name _; + location /manage{ + alias /opt/dist/; + index index.html; + try_files $uri $uri/ /index.html; + } + location / { - root /opt/dist/indexResource; + alias /opt/dist/indexResource/; index index.html; try_files $uri $uri/ /index.html; } @@ -44,11 +49,7 @@ http { client_max_body_size 100m; } - location /manage{ - root /opt/dist; - index index.html; - try_files $uri $uri/ /index.html; - } + diff --git a/qiezi_front/public/index.html b/qiezi_front/public/index.html index f3a1a9f..cc65fa3 100644 --- a/qiezi_front/public/index.html +++ b/qiezi_front/public/index.html @@ -17,6 +17,6 @@
- + diff --git a/qiezi_front/public/indexResource/qieziStatistic_v1.js b/qiezi_front/public/indexResource/qieziStatistic_v1.js index 0e4079d..48b3cf5 100644 --- a/qiezi_front/public/indexResource/qieziStatistic_v1.js +++ b/qiezi_front/public/indexResource/qieziStatistic_v1.js @@ -22,7 +22,7 @@ } }; setTimeout( - () => { + function () { var script = document.createElement("script"); script.type = "text/javascript"; script.defer = true; @@ -44,6 +44,7 @@ key = temp; } } + console.Console(requestHost, key); if (!key) { return; } diff --git a/qiezi_front/src/App.vue b/qiezi_front/src/App.vue index df6a40c..c5383ea 100644 --- a/qiezi_front/src/App.vue +++ b/qiezi_front/src/App.vue @@ -2,8 +2,8 @@
-
页面访问次数:次 
-
 总访客数:
+ +
diff --git a/qiezi_front/src/router/index.js b/qiezi_front/src/router/index.js index ee44e9a..57b83f9 100644 --- a/qiezi_front/src/router/index.js +++ b/qiezi_front/src/router/index.js @@ -2,21 +2,22 @@ import { createRouter, createWebHashHistory } from "vue-router"; import Home from "../views/Home.vue"; const routes = [ - { - path: "/", - name: "Home", - component: Home, - }, - { - path: "/application/sign", - name: "ApplicationSign", - component: () => import("../views/ApplicationSign"), - }, + { + path: "/", + name: "Home", + component: Home, + }, + { + path: "/application/sign", + name: "ApplicationSign", + component: () => import("../views/ApplicationSign"), + }, ]; const router = createRouter({ - history: createWebHashHistory(), - routes, + history: createWebHashHistory(), + base: "manage", + routes, }); export default router; diff --git a/qiezi_front/vue.config.js b/qiezi_front/vue.config.js index 9d8666d..25985c1 100644 --- a/qiezi_front/vue.config.js +++ b/qiezi_front/vue.config.js @@ -2,6 +2,7 @@ //process.env.VUE_APP_QIEZI_HOST = "http://localhost:8080"; //process.env.VUE_APP_QIEZI_KEY = "aab3cad381f54ca5b7b9abeb2e09320a"; module.exports = { + publicPath:"/manage", devServer: { proxy: { "/qiezi/api": {