修改连接器发版
Showing
5 changed files
with
43 additions
and
78 deletions
| ... | @@ -11,3 +11,4 @@ RUN chown -R nginx:nginx /usr/share/nginx/html | ... | @@ -11,3 +11,4 @@ RUN chown -R nginx:nginx /usr/share/nginx/html |
| 11 | EXPOSE 29900 | 11 | EXPOSE 29900 |
| 12 | #CMD:指定容器启动时要运行的命令 | 12 | #CMD:指定容器启动时要运行的命令 |
| 13 | CMD ["nginx", "-g", "daemon off;"] | 13 | CMD ["nginx", "-g", "daemon off;"] |
| 14 | CMD envsubst '${API_BASE_URL}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;' | ... | ... |
| ... | @@ -3,9 +3,9 @@ pipeline { | ... | @@ -3,9 +3,9 @@ pipeline { |
| 3 | //环境定义 | 3 | //环境定义 |
| 4 | environment{ | 4 | environment{ |
| 5 | //服务名称 | 5 | //服务名称 |
| 6 | SVN_FOLD = "fe-data-trusted-space" | 6 | SVN_FOLD = "fe-data-trusted-space-connector" |
| 7 | SSH_PATH = "js-match" | 7 | SSH_PATH = "js-match" |
| 8 | SVN_TYPE = "pre" | 8 | SVN_TYPE = "temp" |
| 9 | image_tag = "1.0.0" | 9 | image_tag = "1.0.0" |
| 10 | ip = "121.237.182.192:30002" | 10 | ip = "121.237.182.192:30002" |
| 11 | port = "59900" | 11 | port = "59900" |
| ... | @@ -85,26 +85,26 @@ pipeline { | ... | @@ -85,26 +85,26 @@ pipeline { |
| 85 | } | 85 | } |
| 86 | } | 86 | } |
| 87 | //部署 | 87 | //部署 |
| 88 | stage('Deploy') { | 88 | // stage('Deploy') { |
| 89 | steps { | 89 | // steps { |
| 90 | echo 'Deploying' | 90 | // echo 'Deploying' |
| 91 | //分分支部署 | 91 | // //分分支部署 |
| 92 | script{ | 92 | // script{ |
| 93 | if(env.BRANCH_NAME=='recover-branch-copy'){ | 93 | // if(env.BRANCH_NAME=='recover-branch-copy'){ |
| 94 | //develop分支环境 | 94 | // //develop分支环境 |
| 95 | echo 'start to deploy ${SVN_FOLD} on develop ...' | 95 | // echo 'start to deploy ${SVN_FOLD} on develop ...' |
| 96 | //调用Publish Over SSH插件,上传docker-compose.yaml文件并且执行deploy脚本 | 96 | // //调用Publish Over SSH插件,上传docker-compose.yaml文件并且执行deploy脚本 |
| 97 | sshPublisher(publishers: [sshPublisherDesc(configName: "js-match", transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: """ | 97 | // sshPublisher(publishers: [sshPublisherDesc(configName: "js-match", transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: """ |
| 98 | #使用k8s构建 | 98 | // #使用k8s构建 |
| 99 | kubectl delete -f /mnt/k8s/daop/release-tds/daop-trust-data-space/fe-data-trusted-space.yaml | 99 | // kubectl delete -f /mnt/k8s/daop/release-tds/daop-trust-data-space/fe-data-trusted-space.yaml |
| 100 | kubectl apply -f /mnt/k8s/daop/release-tds/daop-trust-data-space/fe-data-trusted-space.yaml | 100 | // kubectl apply -f /mnt/k8s/daop/release-tds/daop-trust-data-space/fe-data-trusted-space.yaml |
| 101 | """, execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/mnt/csbr/data', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'output/*.*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)]) | 101 | // """, execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/mnt/csbr/data', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'output/*.*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)]) |
| 102 | 102 | ||
| 103 | echo 'Depoly ${SVN_FOLD} success ...' | 103 | // echo 'Depoly ${SVN_FOLD} success ...' |
| 104 | } | 104 | // } |
| 105 | } | 105 | // } |
| 106 | } | 106 | // } |
| 107 | } | 107 | // } |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | //归档 | 110 | //归档 | ... | ... |
| ... | @@ -2,9 +2,7 @@ server { | ... | @@ -2,9 +2,7 @@ server { |
| 2 | listen 80; | 2 | listen 80; |
| 3 | listen [::]:80; | 3 | listen [::]:80; |
| 4 | server_name localhost; | 4 | server_name localhost; |
| 5 | # server_name http://192.168.6.20:8052; | ||
| 6 | client_max_body_size 100M; | 5 | client_max_body_size 100M; |
| 7 | |||
| 8 | # 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问 | 6 | # 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问 |
| 9 | add_header 'Access-Control-Allow-Origin' * always; | 7 | add_header 'Access-Control-Allow-Origin' * always; |
| 10 | # 设置允许的 HTTP 方法 | 8 | # 设置允许的 HTTP 方法 |
| ... | @@ -28,61 +26,26 @@ server { | ... | @@ -28,61 +26,26 @@ server { |
| 28 | expires -1s; | 26 | expires -1s; |
| 29 | } | 27 | } |
| 30 | 28 | ||
| 31 | location /api { | 29 | location /api/ { |
| 32 | # 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问 | 30 | resolver 127.0.0.11 valid=10s; |
| 33 | add_header 'Access-Control-Allow-Origin' * always; | 31 | proxy_set_header Host $host; |
| 34 | # 设置允许的 HTTP 方法 | 32 | proxy_set_header X-Real-IP $remote_addr; |
| 35 | add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT'; | 33 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 36 | # 设置允许的请求头 | 34 | proxy_set_header X-Forwarded-Proto $scheme; |
| 37 | add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Accept, Origin, X-Requested-With'; | 35 | proxy_set_header X-Forwarded-Port $server_port; |
| 38 | # 如果需要支持 cookie,可以设置以下 header | 36 | proxy_pass http://daop-gateway:8053/; |
| 39 | add_header 'Access-Control-Allow-Credentials' 'true'; | ||
| 40 | # 缓存设置 | ||
| 41 | add_header Cache-Control no-cache; | ||
| 42 | add_header Cache-Control private; | ||
| 43 | |||
| 44 | # 使用 rewrite 将 /api 替换为 /new-api | ||
| 45 | rewrite ^/api/(.*)$ /$1 break; | ||
| 46 | proxy_pass http://192.168.6.20:58052; | ||
| 47 | } | ||
| 48 | |||
| 49 | location /circulation { | ||
| 50 | # 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问 | ||
| 51 | add_header 'Access-Control-Allow-Origin' * always; | ||
| 52 | # 设置允许的 HTTP 方法 | ||
| 53 | add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT'; | ||
| 54 | # 设置允许的请求头 | ||
| 55 | add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Accept, Origin, X-Requested-With'; | ||
| 56 | # 如果需要支持 cookie,可以设置以下 header | ||
| 57 | add_header 'Access-Control-Allow-Credentials' 'true'; | ||
| 58 | # 缓存设置 | ||
| 59 | add_header Cache-Control no-cache; | ||
| 60 | add_header Cache-Control private; | ||
| 61 | |||
| 62 | # 使用 rewrite 将 /circulation 替换为 /new-api | ||
| 63 | rewrite ^/circulation/(.*)$ /$1 break; | ||
| 64 | proxy_pass http://192.168.6.20:18052; | ||
| 65 | } | 37 | } |
| 66 | location /delivery { | ||
| 67 | # 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问 | ||
| 68 | add_header 'Access-Control-Allow-Origin' * always; | ||
| 69 | # 设置允许的 HTTP 方法 | ||
| 70 | add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT'; | ||
| 71 | # 设置允许的请求头 | ||
| 72 | add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Accept, Origin, X-Requested-With'; | ||
| 73 | # 如果需要支持 cookie,可以设置以下 header | ||
| 74 | add_header 'Access-Control-Allow-Credentials' 'true'; | ||
| 75 | # 缓存设置 | ||
| 76 | add_header Cache-Control no-cache; | ||
| 77 | add_header Cache-Control private; | ||
| 78 | 38 | ||
| 79 | # 使用 rewrite 将 /circulation 替换为 /new-api | 39 | # 专门处理 config.json 的 location |
| 80 | rewrite ^/delivery/(.*)$ /$1 break; | 40 | location = /config.json { |
| 81 | proxy_pass http://192.168.6.20:38052; | 41 | # 启用 sub_filter 并指定 MIME 类型为 application/json |
| 42 | sub_filter '{{{API_BASE_URL}}}' '${API_BASE_URL}'; | ||
| 43 | sub_filter_once off; | ||
| 44 | sub_filter_types application/json; # 关键:允许替换 JSON 类型 | ||
| 82 | } | 45 | } |
| 83 | 46 | ||
| 84 | error_page 500 502 503 504 /50x.html; | 47 | error_page 500 502 503 504 /50x.html; |
| 85 | location = /50x.html { | 48 | location = /50x.html { |
| 86 | root /usr/share/nginx/html; | 49 | root /usr/share/nginx/html; |
| 87 | } | 50 | } |
| 88 | } | 51 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -12,6 +12,7 @@ const sysConfigStore = defineStore( | ... | @@ -12,6 +12,7 @@ const sysConfigStore = defineStore( |
| 12 | throw new Error(`请求配置失败,状态码: ${response.status}`); | 12 | throw new Error(`请求配置失败,状态码: ${response.status}`); |
| 13 | } | 13 | } |
| 14 | const config = await response.json(); | 14 | const config = await response.json(); |
| 15 | setConfig(config); | ||
| 15 | return config; | 16 | return config; |
| 16 | } catch (error) { | 17 | } catch (error) { |
| 17 | console.error('加载配置时出错:', error); | 18 | console.error('加载配置时出错:', error); |
| ... | @@ -23,10 +24,10 @@ const sysConfigStore = defineStore( | ... | @@ -23,10 +24,10 @@ const sysConfigStore = defineStore( |
| 23 | } | 24 | } |
| 24 | 25 | ||
| 25 | const getConfig = (field) => { | 26 | const getConfig = (field) => { |
| 26 | if (import.meta.env.MODE == 'nginx' || import.meta.env.MODE == 'development') { | 27 | // if (import.meta.env.MODE == 'nginx' || import.meta.env.MODE == 'development') { |
| 27 | return import.meta.env.VITE_appKey | 28 | // return import.meta.env.VITE_appKey |
| 28 | } | 29 | // } |
| 29 | return field ? configMap[field] : configMap; | 30 | return (field ? configMap[field] : configMap) || '69afd501e4b08251f6cf6419'; |
| 30 | } | 31 | } |
| 31 | 32 | ||
| 32 | return { | 33 | return { | ... | ... |
-
Please register or sign in to post a comment