From f3f9f69de7ce1f66b1fd7e152dbe318152eb57ed Mon Sep 17 00:00:00 2001 From: jmal Date: Tue, 21 May 2024 17:28:35 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=87=AA=E5=AE=9A=E4=B9=89onlyOfficeU?= =?UTF-8?q?RL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-entrypoint.sh | 6 +----- public/config.js | 4 ++++ public/index.html | 2 +- src/components/office/Drawio.vue | 2 +- src/components/office/OnlyOfficeEditor.vue | 3 ++- src/utils/file-config.js | 6 ++++-- 6 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 public/config.js diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 44b8c56..b670073 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,8 +1,4 @@ #!/bin/bash set -e - -# 使用envsubst命令替换nginx.conf.template文件中的环境变量 -envsubst '$API_BASE_URL $API_DRAWIO_URL $API_OFFICE_URL' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf - -# 启动Nginx +envsubst < /var/www/public/config.js > /var/www/public/config.js exec "$@" diff --git a/public/config.js b/public/config.js new file mode 100644 index 0000000..64157ba --- /dev/null +++ b/public/config.js @@ -0,0 +1,4 @@ +window._env_ = { + API_URL: "", + API_OFFICE_URL: "", +}; diff --git a/public/index.html b/public/index.html index 4dfaa70..23a8500 100644 --- a/public/index.html +++ b/public/index.html @@ -35,7 +35,7 @@ <%= webpackConfig.name %> - +