Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-uniapp into master_hella

hella_vue3
niexiting 8 months ago
parent
commit
7eb925f20d
  1. 3
      .env.development
  2. 2
      .env.hella13
  3. 2
      .env.hella14
  4. 2
      .env.hella15
  5. 2
      .env.hella16
  6. 2
      .env.hella8
  7. 2
      .env.hella9
  8. 3
      .env.test
  9. 7
      Dockerfile_prod
  10. 2
      nginx.conf
  11. 57
      nginx_prod.conf
  12. 20
      package.json
  13. 3
      src/api/httpRequest3.js
  14. 6
      src/api/request2.js

3
.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

2
.env.hella13

@ -0,0 +1,2 @@
VITE_BASE_URL=http://172.21.32.13:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api

2
.env.hella14

@ -0,0 +1,2 @@
VITE_BASE_URL=http://172.21.32.14:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api

2
.env.hella15

@ -0,0 +1,2 @@
VITE_BASE_URL=http://172.21.32.15:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.21.32.15:81/admin-api

2
.env.hella16

@ -0,0 +1,2 @@
VITE_BASE_URL=http://172.21.32.16:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.21.32.16:81/admin-api

2
.env.hella8

@ -0,0 +1,2 @@
VITE_BASE_URL=http://172.22.32.8:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.22.32.8:81/admin-api

2
.env.hella9

@ -0,0 +1,2 @@
VITE_BASE_URL=http://172.22.32.9:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.22.32.9:81/admin-api

3
.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

7
Dockerfile_prod

@ -0,0 +1,7 @@
# 设置基础镜像
FROM win-nginx
WORKDIR /opt/sfms3.0-uniapp
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

2
nginx.conf

@ -32,7 +32,7 @@ http {
server { server {
listen 25302; listen 25302;
server_name_in_redirect off; server_name_in_redirect off;
server_name dev.ccwin-in.com; server_name _;
location /api/ { location /api/ {
proxy_pass http://sfms3.0/; proxy_pass http://sfms3.0/;
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header; proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header;

57
nginx_prod.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;
}
}
}

20
package.json

@ -5,17 +5,21 @@
"dev:app": "uni -p app", "dev:app": "uni -p app",
"dev:app-android": "uni -p app-android", "dev:app-android": "uni -p app-android",
"dev:app-ios": "uni -p app-ios", "dev:app-ios": "uni -p app-ios",
"dev:custom": "uni -p",
"dev": "uni", "dev": "uni",
"dev:h5:ssr": "uni --ssr", "dev:h5:ssr": "uni --ssr",
"dev:mp-weixin": "uni -p mp-weixin", "dev:mp-weixin": "uni -p mp-weixin",
"build:app": "uni build -p app", "hella8:app": "uni build -p app --mode hella8",
"build:app-android": "uni build -p app-android", "hella8:app-android": "uni build -p app-android --mode hella8",
"build:app-ios": "uni build -p app-ios", "hella8:app-ios": "uni build -p app-ios --mode hella8",
"build:custom": "uni build -p", "hella8:h5:ssr": "uni build --ssr --mode hella8",
"test": "uni build", "hella8:mp-weixin": "uni build -p mp-weixin --mode hella8",
"build:h5:ssr": "uni build --ssr", "test": "uni build --mode test",
"build:mp-weixin": "uni build -p mp-weixin" "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": { "dependencies": {
"@dcloudio/uni-app": "3.0.0-3090920231225001", "@dcloudio/uni-app": "3.0.0-3090920231225001",

3
src/api/httpRequest3.js

@ -1,6 +1,5 @@
import storage from '../common/utils/storage' import storage from '../common/utils/storage'
import config from '../static/config.js'
function service(options = {}) { function service(options = {}) {
var token = storage.getStorage(storage.constant.token) var token = storage.getStorage(storage.constant.token)
@ -13,7 +12,7 @@ function service(options = {}) {
// requestUrl = getApp().globalData.request_url // requestUrl = getApp().globalData.request_url
// } // }
var requestUrl = "" var requestUrl = ""
requestUrl =config.request_url requestUrl = import.meta.env.VITE_BASE_URL
options.header = { options.header = {
"content-type": "application/json", "content-type": "application/json",

6
src/api/request2.js

@ -1,10 +1,8 @@
import request from './httpRequest3.js' import request from './httpRequest3.js'
import storage from '../common/utils/storage.js' import storage from '../common/utils/storage.js'
import config from '../static/config.js'
// const baseApi = "/api/admin-api"
//公司地址 //公司地址
// 本地地址 // 本地地址
const baseApi = "" const baseApi = ''
/** /**
* 获取验证码 * 获取验证码
* @param {*} * @param {*}
@ -3820,7 +3818,7 @@ export function getFileList(tableName, tableId) {
*/ */
export function uploadFile(tableName, tableId, filePath, callBack) { export function uploadFile(tableName, tableId, filePath, callBack) {
var token = storage.getStorage(storage.constant.token) var token = storage.getStorage(storage.constant.token)
var url = config.request_url + baseApi var url = import.meta.env.VITE_BASE_URL + baseApi
uni.uploadFile({ uni.uploadFile({
url: url + "/infra/file/upload?tableName=" + tableName + "&tableId=" + tableId, url: url + "/infra/file/upload?tableName=" + tableName + "&tableId=" + tableId,
filePath: filePath, filePath: filePath,

Loading…
Cancel
Save