3233b39b by lihua

修改连接器发版

1 parent 88053911
......@@ -11,3 +11,4 @@ RUN chown -R nginx:nginx /usr/share/nginx/html
EXPOSE 29900
#CMD:指定容器启动时要运行的命令
CMD ["nginx", "-g", "daemon off;"]
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 {
//环境定义
environment{
//服务名称
SVN_FOLD = "fe-data-trusted-space"
SVN_FOLD = "fe-data-trusted-space-connector"
SSH_PATH = "js-match"
SVN_TYPE = "pre"
SVN_TYPE = "temp"
image_tag = "1.0.0"
ip = "121.237.182.192:30002"
port = "59900"
......@@ -85,26 +85,26 @@ pipeline {
}
}
//部署
stage('Deploy') {
steps {
echo 'Deploying'
//分分支部署
script{
if(env.BRANCH_NAME=='recover-branch-copy'){
//develop分支环境
echo 'start to deploy ${SVN_FOLD} on develop ...'
//调用Publish Over SSH插件,上传docker-compose.yaml文件并且执行deploy脚本
sshPublisher(publishers: [sshPublisherDesc(configName: "js-match", transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: """
#使用k8s构建
kubectl delete -f /mnt/k8s/daop/release-tds/daop-trust-data-space/fe-data-trusted-space.yaml
kubectl apply -f /mnt/k8s/daop/release-tds/daop-trust-data-space/fe-data-trusted-space.yaml
""", execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/mnt/csbr/data', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'output/*.*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
// stage('Deploy') {
// steps {
// echo 'Deploying'
// //分分支部署
// script{
// if(env.BRANCH_NAME=='recover-branch-copy'){
// //develop分支环境
// echo 'start to deploy ${SVN_FOLD} on develop ...'
// //调用Publish Over SSH插件,上传docker-compose.yaml文件并且执行deploy脚本
// sshPublisher(publishers: [sshPublisherDesc(configName: "js-match", transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: """
// #使用k8s构建
// kubectl delete -f /mnt/k8s/daop/release-tds/daop-trust-data-space/fe-data-trusted-space.yaml
// kubectl apply -f /mnt/k8s/daop/release-tds/daop-trust-data-space/fe-data-trusted-space.yaml
// """, execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/mnt/csbr/data', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'output/*.*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
echo 'Depoly ${SVN_FOLD} success ...'
}
}
}
}
// echo 'Depoly ${SVN_FOLD} success ...'
// }
// }
// }
// }
}
//归档
......
......@@ -2,9 +2,7 @@ server {
listen 80;
listen [::]:80;
server_name localhost;
# server_name http://192.168.6.20:8052;
client_max_body_size 100M;
# 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问
add_header 'Access-Control-Allow-Origin' * always;
# 设置允许的 HTTP 方法
......@@ -28,57 +26,22 @@ server {
expires -1s;
}
location /api {
# 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问
add_header 'Access-Control-Allow-Origin' * always;
# 设置允许的 HTTP 方法
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT';
# 设置允许的请求头
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Accept, Origin, X-Requested-With';
# 如果需要支持 cookie,可以设置以下 header
add_header 'Access-Control-Allow-Credentials' 'true';
# 缓存设置
add_header Cache-Control no-cache;
add_header Cache-Control private;
# 使用 rewrite 将 /api 替换为 /new-api
rewrite ^/api/(.*)$ /$1 break;
proxy_pass http://192.168.6.20:58052;
}
location /circulation {
# 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问
add_header 'Access-Control-Allow-Origin' * always;
# 设置允许的 HTTP 方法
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT';
# 设置允许的请求头
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Accept, Origin, X-Requested-With';
# 如果需要支持 cookie,可以设置以下 header
add_header 'Access-Control-Allow-Credentials' 'true';
# 缓存设置
add_header Cache-Control no-cache;
add_header Cache-Control private;
# 使用 rewrite 将 /circulation 替换为 /new-api
rewrite ^/circulation/(.*)$ /$1 break;
proxy_pass http://192.168.6.20:18052;
location /api/ {
resolver 127.0.0.11 valid=10s;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_pass http://daop-gateway:8053/;
}
location /delivery {
# 设置允许跨域的域名,可以使用通配符 '*' 允许所有域访问
add_header 'Access-Control-Allow-Origin' * always;
# 设置允许的 HTTP 方法
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT';
# 设置允许的请求头
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Accept, Origin, X-Requested-With';
# 如果需要支持 cookie,可以设置以下 header
add_header 'Access-Control-Allow-Credentials' 'true';
# 缓存设置
add_header Cache-Control no-cache;
add_header Cache-Control private;
# 使用 rewrite 将 /circulation 替换为 /new-api
rewrite ^/delivery/(.*)$ /$1 break;
proxy_pass http://192.168.6.20:38052;
# 专门处理 config.json 的 location
location = /config.json {
# 启用 sub_filter 并指定 MIME 类型为 application/json
sub_filter '{{{API_BASE_URL}}}' '${API_BASE_URL}';
sub_filter_once off;
sub_filter_types application/json; # 关键:允许替换 JSON 类型
}
error_page 500 502 503 504 /50x.html;
......
{
"appKey": "67bd3018e4b0cac8f9a5beeb"
"appKey": "{{{APP_KEY}}}"
}
......
......@@ -12,6 +12,7 @@ const sysConfigStore = defineStore(
throw new Error(`请求配置失败,状态码: ${response.status}`);
}
const config = await response.json();
setConfig(config);
return config;
} catch (error) {
console.error('加载配置时出错:', error);
......@@ -23,10 +24,10 @@ const sysConfigStore = defineStore(
}
const getConfig = (field) => {
if (import.meta.env.MODE == 'nginx' || import.meta.env.MODE == 'development') {
return import.meta.env.VITE_appKey
}
return field ? configMap[field] : configMap;
// if (import.meta.env.MODE == 'nginx' || import.meta.env.MODE == 'development') {
// return import.meta.env.VITE_appKey
// }
return (field ? configMap[field] : configMap) || '69afd501e4b08251f6cf6419';
}
return {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!