diff --git a/README.md b/README.md index d92d1bd..d12c5ef 100644 --- a/README.md +++ b/README.md @@ -214,9 +214,7 @@ cd ../ # ############ # 进入 frontend 目录 cd frontend -# 建议使用 cnpm 安装依赖,如果没有安装 cnpm,可以通过 npm i cnpm 进行安装 -cnpm install -# npm install --legacy-peer-deps +npm install # 回到项目根目录下 cd ../ ``` @@ -306,6 +304,17 @@ npm run package +#### 管理员前端项目打包并嵌入后端 + +``` +cd frontend +npm run build +``` + +然后将 `frontend/dist` 文件夹移动到 `backend/microservice-gateway/src/main/resources/static` 文件夹下,并修改文件夹名称 `dist` 为 `manage` + + + #### 后端配置 ##### 配置业务域名 @@ -314,6 +323,9 @@ npm run package ``` const baseUrl = "https://【⚠此处修改为你的业务域名】/" // 以 / 结尾,例如:https://epp.only4.work/ + +// 或者也可使用相对路径,例如: +const baseUrl = "/" ``` @@ -389,6 +401,7 @@ IDEA 中右侧 Maven 双击 Lifestyle 的 package,打包完成后的 jar 包 🌟若使用的 Nacos 版本大于或等于 Nacos 2.2.0.1,则需要配置自定义密钥: ```properties +# 密钥值可以自己指定,此处的自定义密钥来自 nacos 官网 nacos.core.auth.plugin.nacos.token.secret.key=VGhpc0lzTXlDdXN0b21TZWNyZXRLZXkwMTIzNDU2Nzg= ``` @@ -396,7 +409,9 @@ nacos.core.auth.plugin.nacos.token.secret.key=VGhpc0lzTXlDdXN0b21TZWNyZXRLZXkwMT -#### nginx 代理配置(可选) +#### nginx 代理配置 + +##### 反向代理(可选) 配置文件在 `nginx-conf` 目录下(不能直接拿来用,需要根据自己的实际情况来改) @@ -425,6 +440,10 @@ server } ``` +##### SSL证书配置(可选) + +如果域名配置为 https:// 则需要配置 SSL 证书。SSL证书可在 nginx 中进行配置,具体配置方法此处省略。 + ## 启动项目 diff --git a/TODOs.md b/TODOs.md index a5cd008..9cd0332 100644 --- a/TODOs.md +++ b/TODOs.md @@ -42,6 +42,21 @@ Java代码中小程序AppID、密钥处理,小程序代码中小程序AppID处理 +# host 文件地址 + +C:\Windows\System32\drivers\etc + +配置项 + +127.0.0.1 epp.only4.work +127.0.0.1 epp-prod.only4.work + +查看配置 + +ping epp.only4.work +ping epp-prod.only4.work + + # 后端项目启动命令 diff --git a/backend/microservice-provider-access-8002/src/main/resources/static/README.txt b/backend/microservice-gateway/src/main/resources/static/README.txt similarity index 62% rename from backend/microservice-provider-access-8002/src/main/resources/static/README.txt rename to backend/microservice-gateway/src/main/resources/static/README.txt index 347fd9b..dbab531 100644 --- a/backend/microservice-provider-access-8002/src/main/resources/static/README.txt +++ b/backend/microservice-gateway/src/main/resources/static/README.txt @@ -1 +1,3 @@ 编辑后右键 Compile And Reload File 修改即可生效,不用频繁重启项目 + +manage 文件夹下为 frontend 项目打包产物 \ No newline at end of file diff --git a/backend/microservice-gateway/src/main/resources/static/assets/image/miniprogram.jpg b/backend/microservice-gateway/src/main/resources/static/assets/image/miniprogram.jpg new file mode 100644 index 0000000..557e8cf Binary files /dev/null and b/backend/microservice-gateway/src/main/resources/static/assets/image/miniprogram.jpg differ diff --git a/backend/microservice-provider-access-8002/src/main/resources/static/access/assets/css/index.css b/backend/microservice-gateway/src/main/resources/static/guard/assets/css/index.css similarity index 100% rename from backend/microservice-provider-access-8002/src/main/resources/static/access/assets/css/index.css rename to backend/microservice-gateway/src/main/resources/static/guard/assets/css/index.css diff --git a/backend/microservice-provider-access-8002/src/main/resources/static/access/assets/css/setting-panel.css b/backend/microservice-gateway/src/main/resources/static/guard/assets/css/setting-panel.css similarity index 100% rename from backend/microservice-provider-access-8002/src/main/resources/static/access/assets/css/setting-panel.css rename to backend/microservice-gateway/src/main/resources/static/guard/assets/css/setting-panel.css diff --git a/backend/microservice-provider-access-8002/src/main/resources/static/access/assets/js/setting-panel.js b/backend/microservice-gateway/src/main/resources/static/guard/assets/js/setting-panel.js similarity index 100% rename from backend/microservice-provider-access-8002/src/main/resources/static/access/assets/js/setting-panel.js rename to backend/microservice-gateway/src/main/resources/static/guard/assets/js/setting-panel.js diff --git a/backend/microservice-provider-access-8002/src/main/resources/static/access/assets/js/websocket.js b/backend/microservice-gateway/src/main/resources/static/guard/assets/js/websocket.js similarity index 100% rename from backend/microservice-provider-access-8002/src/main/resources/static/access/assets/js/websocket.js rename to backend/microservice-gateway/src/main/resources/static/guard/assets/js/websocket.js diff --git a/backend/microservice-provider-access-8002/src/main/resources/static/access/assets/svg/close.svg b/backend/microservice-gateway/src/main/resources/static/guard/assets/svg/close.svg similarity index 100% rename from backend/microservice-provider-access-8002/src/main/resources/static/access/assets/svg/close.svg rename to backend/microservice-gateway/src/main/resources/static/guard/assets/svg/close.svg diff --git a/backend/microservice-provider-access-8002/src/main/resources/static/access/assets/svg/fullscreen.svg b/backend/microservice-gateway/src/main/resources/static/guard/assets/svg/fullscreen.svg similarity index 100% rename from backend/microservice-provider-access-8002/src/main/resources/static/access/assets/svg/fullscreen.svg rename to backend/microservice-gateway/src/main/resources/static/guard/assets/svg/fullscreen.svg diff --git a/backend/microservice-provider-access-8002/src/main/resources/static/access/assets/svg/setting.svg b/backend/microservice-gateway/src/main/resources/static/guard/assets/svg/setting.svg similarity index 100% rename from backend/microservice-provider-access-8002/src/main/resources/static/access/assets/svg/setting.svg rename to backend/microservice-gateway/src/main/resources/static/guard/assets/svg/setting.svg diff --git a/backend/microservice-provider-access-8002/src/main/resources/static/access/index.html b/backend/microservice-gateway/src/main/resources/static/guard/index.html similarity index 100% rename from backend/microservice-provider-access-8002/src/main/resources/static/access/index.html rename to backend/microservice-gateway/src/main/resources/static/guard/index.html diff --git a/backend/microservice-provider-access-8002/src/main/resources/static/access/renderer.js b/backend/microservice-gateway/src/main/resources/static/guard/renderer.js similarity index 98% rename from backend/microservice-provider-access-8002/src/main/resources/static/access/renderer.js rename to backend/microservice-gateway/src/main/resources/static/guard/renderer.js index 56864e8..c88563e 100644 --- a/backend/microservice-provider-access-8002/src/main/resources/static/access/renderer.js +++ b/backend/microservice-gateway/src/main/resources/static/guard/renderer.js @@ -1,5 +1,5 @@ // 定义常量 -const baseUrl = "https://epp.only4.work/" +const baseUrl = "/" // "https://epp.only4.work/" const url = baseUrl + "access/wechat/getUnlimitedQRCode" const page = "pages/index/index" // "pages/scan/entrance" const envVersion = "develop" // 正式版为 "release",体验版为 "trial",开发版为 "develop" diff --git a/backend/microservice-gateway/src/main/resources/static/index.html b/backend/microservice-gateway/src/main/resources/static/index.html new file mode 100644 index 0000000..ae1aeaf --- /dev/null +++ b/backend/microservice-gateway/src/main/resources/static/index.html @@ -0,0 +1,92 @@ + + + +
+ + + +epp.only4.work
+ ++ +
+