From 2981c09a6283da68b0b32566d5019ccf0a3420c5 Mon Sep 17 00:00:00 2001 From: liuchen864 <23082234@qq.com> Date: Sun, 14 Apr 2024 08:29:35 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=9B=B4=E6=94=B9nginx=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 04e4b8a9..2b8d1e32 100644 --- a/nginx.conf +++ b/nginx.conf @@ -32,7 +32,7 @@ http { server { listen 25302; server_name_in_redirect off; - server_name dev.ccwin-in.com; + server_name _; location /api/ { proxy_pass http://sfms3.0/; proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header; From e2098739492006006764422a1dc12f0a41205db5 Mon Sep 17 00:00:00 2001 From: liuchen864 <23082234@qq.com> Date: Sun, 14 Apr 2024 11:56:04 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=B7=E6=8B=89?= =?UTF-8?q?=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile_hella | 7 ++++++ nginx_hella.conf | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 Dockerfile_hella create mode 100644 nginx_hella.conf diff --git a/Dockerfile_hella b/Dockerfile_hella new file mode 100644 index 00000000..6943e69d --- /dev/null +++ b/Dockerfile_hella @@ -0,0 +1,7 @@ +# 设置基础镜像 +FROM win-nginx + +WORKDIR /opt/sfms3.0-uniapp +COPY nginx_hella.conf /usr/local/nginx/conf/nginx.conf +# 将dist/build/h5/文件中的内容复制到 /opt/sfms3.0-uniapp 这个目录下面 +COPY dist/build/h5/ /opt/sfms3.0-uniapp diff --git a/nginx_hella.conf b/nginx_hella.conf new file mode 100644 index 00000000..2f9b3691 --- /dev/null +++ b/nginx_hella.conf @@ -0,0 +1,57 @@ +user root; +worker_processes 2; + +events { + worker_connections 1024; +} + +http { + include mime.types; + charset utf-8,gbk; + default_type application/octet-stream; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for" "$request_time $upstream_response_time"'; + + proxy_cache_path /opt/nginx_cache/ levels=1:2 keys_zone=my_zone:10m inactive=300s max_size=5g; + access_log logs/access.log main; + sendfile on; + #tcp_nopush on; + keepalive_timeout 600s; + client_max_body_size 200m; + gzip on; + gzip_min_length 10k; + gzip_comp_level 9; + gzip_buffers 4 16k; + gzip_types text/plain application/javascript text/css application/xml text/javascript image/jpeg image/gif image/png; + gzip_vary on; + gzip_disable "MSIE [1-6]\."; + upstream sfms3.0 { + server localhost:90 weight=10 max_fails=3 fail_timeout=10s; + } + server { + listen 81; + server_name_in_redirect off; + server_name _; + location /api/ { + proxy_pass http://sfms3.0/; + proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header; + proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $http_x_forwarded_for; + } + location /profile/ { + alias /opt/profile/; + index index.html index.htm; + } + location / { + proxy_cache my_zone; + proxy_cache_valid 200 304 12h; + proxy_cache_key $host$uri$is_args$args; + try_files $uri $uri/ /index.html; + root /opt/sfms3.0-uniapp; + index index.html index.htm; + } + } +} \ No newline at end of file From 4da7dcc15f8e44da2c480428b1fd7e8c6dbb5535 Mon Sep 17 00:00:00 2001 From: liuchen864 <23082234@qq.com> Date: Sun, 14 Apr 2024 12:09:02 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile_hella => Dockerfile_prod | 2 +- nginx_hella.conf => nginx_prod.conf | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename Dockerfile_hella => Dockerfile_prod (77%) rename nginx_hella.conf => nginx_prod.conf (100%) diff --git a/Dockerfile_hella b/Dockerfile_prod similarity index 77% rename from Dockerfile_hella rename to Dockerfile_prod index 6943e69d..116cbdac 100644 --- a/Dockerfile_hella +++ b/Dockerfile_prod @@ -2,6 +2,6 @@ FROM win-nginx WORKDIR /opt/sfms3.0-uniapp -COPY nginx_hella.conf /usr/local/nginx/conf/nginx.conf +COPY nginx_prod.conf /usr/local/nginx/conf/nginx.conf # 将dist/build/h5/文件中的内容复制到 /opt/sfms3.0-uniapp 这个目录下面 COPY dist/build/h5/ /opt/sfms3.0-uniapp diff --git a/nginx_hella.conf b/nginx_prod.conf similarity index 100% rename from nginx_hella.conf rename to nginx_prod.conf From 19a677fcc149c1ab0681f01f35b8a88e01383f1b Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Mon, 15 Apr 2024 13:01:20 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=9C=B0=E5=9D=80=E5=88=86=E7=8E=AF?= =?UTF-8?q?=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 3 +++ .env.hella13 | 2 ++ .env.hella14 | 2 ++ .env.hella15 | 2 ++ .env.hella16 | 2 ++ .env.hella8 | 2 ++ .env.hella9 | 2 ++ .env.production | 2 ++ .env.test | 3 +++ src/api/httpRequest3.js | 3 +-- src/api/request2.js | 6 ++---- 11 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 .env.development create mode 100644 .env.hella13 create mode 100644 .env.hella14 create mode 100644 .env.hella15 create mode 100644 .env.hella16 create mode 100644 .env.hella8 create mode 100644 .env.hella9 create mode 100644 .env.production create mode 100644 .env.test diff --git a/.env.development b/.env.development new file mode 100644 index 00000000..c00b9fbb --- /dev/null +++ b/.env.development @@ -0,0 +1,3 @@ + +VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api +VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api \ No newline at end of file diff --git a/.env.hella13 b/.env.hella13 new file mode 100644 index 00000000..6161f509 --- /dev/null +++ b/.env.hella13 @@ -0,0 +1,2 @@ +VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api +VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api \ No newline at end of file diff --git a/.env.hella14 b/.env.hella14 new file mode 100644 index 00000000..6161f509 --- /dev/null +++ b/.env.hella14 @@ -0,0 +1,2 @@ +VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api +VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api \ No newline at end of file diff --git a/.env.hella15 b/.env.hella15 new file mode 100644 index 00000000..6161f509 --- /dev/null +++ b/.env.hella15 @@ -0,0 +1,2 @@ +VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api +VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api \ No newline at end of file diff --git a/.env.hella16 b/.env.hella16 new file mode 100644 index 00000000..6161f509 --- /dev/null +++ b/.env.hella16 @@ -0,0 +1,2 @@ +VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api +VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api \ No newline at end of file diff --git a/.env.hella8 b/.env.hella8 new file mode 100644 index 00000000..6161f509 --- /dev/null +++ b/.env.hella8 @@ -0,0 +1,2 @@ +VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api +VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api \ No newline at end of file diff --git a/.env.hella9 b/.env.hella9 new file mode 100644 index 00000000..6161f509 --- /dev/null +++ b/.env.hella9 @@ -0,0 +1,2 @@ +VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api +VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 00000000..6161f509 --- /dev/null +++ b/.env.production @@ -0,0 +1,2 @@ +VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api +VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api \ No newline at end of file diff --git a/.env.test b/.env.test new file mode 100644 index 00000000..c00b9fbb --- /dev/null +++ b/.env.test @@ -0,0 +1,3 @@ + +VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api +VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api \ No newline at end of file diff --git a/src/api/httpRequest3.js b/src/api/httpRequest3.js index e3e374f8..29dd44a6 100644 --- a/src/api/httpRequest3.js +++ b/src/api/httpRequest3.js @@ -1,6 +1,5 @@ import storage from '../common/utils/storage' -import config from '../static/config.js' function service(options = {}) { var token = storage.getStorage(storage.constant.token) @@ -13,7 +12,7 @@ function service(options = {}) { // requestUrl = getApp().globalData.request_url // } var requestUrl = "" - requestUrl =config.request_url + requestUrl = import.meta.env.VITE_BASE_URL options.header = { "content-type": "application/json", diff --git a/src/api/request2.js b/src/api/request2.js index 274a1e26..95f16a9b 100644 --- a/src/api/request2.js +++ b/src/api/request2.js @@ -1,10 +1,8 @@ import request from './httpRequest3.js' import storage from '../common/utils/storage.js' -import config from '../static/config.js' -// const baseApi = "/api/admin-api" //公司地址 // 本地地址 -const baseApi = "" +const baseApi = '' /** * 获取验证码 * @param {*} @@ -3811,7 +3809,7 @@ export function getFileList(tableName, tableId) { */ export function uploadFile(tableName, tableId, filePath, callBack) { var token = storage.getStorage(storage.constant.token) - var url = config.request_url + baseApi + var url = import.meta.env.VITE_BASE_URL + baseApi uni.uploadFile({ url: url + "/infra/file/upload?tableName=" + tableName + "&tableId=" + tableId, filePath: filePath, From 64831c1f73193ea4dc0f7a50cd67fcce6f50408c Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Mon, 15 Apr 2024 13:06:43 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=88=86=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 38bd5511..e39e42a4 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,20 @@ "dev": "uni", "dev:h5:ssr": "uni --ssr", "dev:mp-weixin": "uni -p mp-weixin", - "build:app": "uni build -p app", - "build:app-android": "uni build -p app-android", - "build:app-ios": "uni build -p app-ios", - "build:custom": "uni build -p", - "test": "uni build", - "build:h5:ssr": "uni build --ssr", - "build:mp-weixin": "uni build -p mp-weixin" + "prod:app": "uni build -p app --mode production", + "prod:app-android": "uni build -p app-android --mode production", + "prod:app-ios": "uni build -p app-ios --mode production", + "prod:custom": "uni build -p --mode production", + "prod:h5:ssr": "uni build --ssr --mode production", + "prod:mp-weixin": "uni build -p mp-weixin --mode production", + "prod": "uni build --mode production", + "test": "uni build --mode test", + "hella8": "vite build --mode hella8", + "hella9": "vite build --mode hella9", + "hella13": "vite build --mode hella13", + "hella14": "vite build --mode hella14", + "hella15": "vite build --mode hella15", + "hella16": "vite build --mode hella16" }, "dependencies": { "@dcloudio/uni-app": "3.0.0-3090920231225001", From 26981d77e1fc20964b589154340a1a0a70bf0308 Mon Sep 17 00:00:00 2001 From: liuchen864 <23082234@qq.com> Date: Mon, 15 Apr 2024 13:11:07 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E5=92=8C=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.hella13 | 4 ++-- .env.hella14 | 4 ++-- .env.hella15 | 4 ++-- .env.hella16 | 4 ++-- .env.hella8 | 4 ++-- .env.hella9 | 4 ++-- .env.production | 2 -- package.json | 25 +++++++++++-------------- 8 files changed, 23 insertions(+), 28 deletions(-) delete mode 100644 .env.production diff --git a/.env.hella13 b/.env.hella13 index 6161f509..3512fc6e 100644 --- a/.env.hella13 +++ b/.env.hella13 @@ -1,2 +1,2 @@ -VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api -VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api \ No newline at end of file +VITE_BASE_URL=http://172.21.32.13:81/api/admin-api +VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api \ No newline at end of file diff --git a/.env.hella14 b/.env.hella14 index 6161f509..ba00ae52 100644 --- a/.env.hella14 +++ b/.env.hella14 @@ -1,2 +1,2 @@ -VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api -VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api \ No newline at end of file +VITE_BASE_URL=http://172.21.32.14:81/api/admin-api +VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api \ No newline at end of file diff --git a/.env.hella15 b/.env.hella15 index 6161f509..054fde1c 100644 --- a/.env.hella15 +++ b/.env.hella15 @@ -1,2 +1,2 @@ -VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api -VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api \ No newline at end of file +VITE_BASE_URL=http://172.21.32.15:81/api/admin-api +VITE_BASE_URL_IMAGE=http://172.21.32.15:81/admin-api \ No newline at end of file diff --git a/.env.hella16 b/.env.hella16 index 6161f509..f53c372b 100644 --- a/.env.hella16 +++ b/.env.hella16 @@ -1,2 +1,2 @@ -VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api -VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api \ No newline at end of file +VITE_BASE_URL=http://172.21.32.16:81/api/admin-api +VITE_BASE_URL_IMAGE=http://172.21.32.16:81/admin-api \ No newline at end of file diff --git a/.env.hella8 b/.env.hella8 index 6161f509..0cc65e7d 100644 --- a/.env.hella8 +++ b/.env.hella8 @@ -1,2 +1,2 @@ -VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api -VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api \ No newline at end of file +VITE_BASE_URL=http://172.22.32.8:81/api/admin-api +VITE_BASE_URL_IMAGE=http://172.22.32.8:81/admin-api \ No newline at end of file diff --git a/.env.hella9 b/.env.hella9 index 6161f509..d399e4d7 100644 --- a/.env.hella9 +++ b/.env.hella9 @@ -1,2 +1,2 @@ -VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api -VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api \ No newline at end of file +VITE_BASE_URL=http://172.22.32.9:81/api/admin-api +VITE_BASE_URL_IMAGE=http://172.22.32.9:81/admin-api \ No newline at end of file diff --git a/.env.production b/.env.production deleted file mode 100644 index 6161f509..00000000 --- a/.env.production +++ /dev/null @@ -1,2 +0,0 @@ -VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api -VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api \ No newline at end of file diff --git a/package.json b/package.json index e39e42a4..c01b8a9d 100644 --- a/package.json +++ b/package.json @@ -5,24 +5,21 @@ "dev:app": "uni -p app", "dev:app-android": "uni -p app-android", "dev:app-ios": "uni -p app-ios", - "dev:custom": "uni -p", "dev": "uni", "dev:h5:ssr": "uni --ssr", "dev:mp-weixin": "uni -p mp-weixin", - "prod:app": "uni build -p app --mode production", - "prod:app-android": "uni build -p app-android --mode production", - "prod:app-ios": "uni build -p app-ios --mode production", - "prod:custom": "uni build -p --mode production", - "prod:h5:ssr": "uni build --ssr --mode production", - "prod:mp-weixin": "uni build -p mp-weixin --mode production", - "prod": "uni build --mode production", + "hella8:app": "uni build -p app --mode hella8", + "hella8:app-android": "uni build -p app-android --mode hella8", + "hella8:app-ios": "uni build -p app-ios --mode hella8", + "hella8:h5:ssr": "uni build --ssr --mode hella8", + "hella8:mp-weixin": "uni build -p mp-weixin --mode hella8", "test": "uni build --mode test", - "hella8": "vite build --mode hella8", - "hella9": "vite build --mode hella9", - "hella13": "vite build --mode hella13", - "hella14": "vite build --mode hella14", - "hella15": "vite build --mode hella15", - "hella16": "vite build --mode hella16" + "hella8": "vite build --mode hella8", + "hella9": "vite build --mode hella9", + "hella13": "vite build --mode hella13", + "hella14": "vite build --mode hella14", + "hella15": "vite build --mode hella15", + "hella16": "vite build --mode hella16" }, "dependencies": { "@dcloudio/uni-app": "3.0.0-3090920231225001",