Просмотр исходного кода

[Fix SEC-20260913] 基座地址与端口配置化,清除硬编码 IP

lizuo 1 неделя назад
Родитель
Сommit
4b94efbdf8

+ 5 - 2
public/fileEdit.html

@@ -7,8 +7,11 @@
 <body>
 <body>
 
 
 <div id="fileEdit"></div>
 <div id="fileEdit"></div>
-<!--// 页面引入document的api.js-->
-<script type="text/javascript" src="http://47.94.222.6:9050/web-apps/apps/api/documents/api.js"></script>
+<!--// 页面引入document的api.js([SEC-20260913] 原硬编码 OnlyOffice 服务地址死链改为运行时配置下发:onlyOfficeUrl 反代前缀,与 src/utils/onlyOffice.ts 同约定)-->
+<script type="text/javascript" src="/js/config.js"></script>
+<script type="text/javascript">
+    document.write('<script type="text/javascript" src="' + ((typeof VUE_APP_URL !== 'undefined' && VUE_APP_URL.onlyOfficeUrl) || '/documents') + '/web-apps/apps/api/documents/api.js"><\/script>');
+</script>
 <script>
 <script>
 
 
     //office文件在线编辑、预览
     //office文件在线编辑、预览

+ 1 - 1
public/js/config.js

@@ -1,7 +1,7 @@
 const VUE_APP_URL = {
 const VUE_APP_URL = {
   baseUrl: "/modelreq", // 后台地址
   baseUrl: "/modelreq", // 后台地址
   webRtcUrl: '/webRtc', // rtsp服务器IP地址
   webRtcUrl: '/webRtc', // rtsp服务器IP地址
-  wsUrl: 'http://182.92.126.35:9999', // WebSocket 地址
+  wsUrl: window.location.origin + '/modelreq', // [SEC-20260913] WebSocket 地址:同源经 /modelreq 反代至网关(覆盖旧云环境硬编码 IP)
   onlyOfficeUrl: '/documents', // [perf-base-v1] 卡1: OnlyOffice Document Server 反向代理前缀(api.js 按需加载时拼接)
   onlyOfficeUrl: '/documents', // [perf-base-v1] 卡1: OnlyOffice Document Server 反向代理前缀(api.js 按需加载时拼接)
 }
 }
 const History_Type = {
 const History_Type = {

+ 1 - 1
public/mxcad/mxServerConfig.json

@@ -24,7 +24,7 @@
 	"?saveUrl": "保存文件服务地址",
 	"?saveUrl": "保存文件服务地址",
 	"saveUrl": "http://localhost:1337/mxcad/savemxweb",
 	"saveUrl": "http://localhost:1337/mxcad/savemxweb",
 	"?saveDwgUrl": "保存DWG文件服务地址",
 	"?saveDwgUrl": "保存DWG文件服务地址",
-	"saveDwgUrl": "http://182.92.126.35:8092/modelreq/safety/cadFile/transformCadFileType",
+	"saveDwgUrl": "/modelreq/safety/cadFile/transformCadFileType",
 	"?printPdfUrl": "把指定范围输出到pdf的服务地址",
 	"?printPdfUrl": "把指定范围输出到pdf的服务地址",
 	"printPdfUrl": "http://localhost:1337/mxcad/print_to_pdf",
 	"printPdfUrl": "http://localhost:1337/mxcad/print_to_pdf",
     "?cutDwgUrl": "把指定范围输出到DWG的服务地址",
     "?cutDwgUrl": "把指定范围输出到DWG的服务地址",

+ 4 - 2
src/layouts/default/header/components/VoiceBroadcast.vue

@@ -58,6 +58,7 @@
   import { usePermissionStore } from '/@/store/modules/permission';
   import { usePermissionStore } from '/@/store/modules/permission';
   import SpeakVoice from './notify/speakVoice';
   import SpeakVoice from './notify/speakVoice';
   import { useDrag } from '@/hooks/event/useDrag';
   import { useDrag } from '@/hooks/event/useDrag';
+  import { useGlobSetting } from '/@/hooks/setting';
   import dayjs from 'dayjs';
   import dayjs from 'dayjs';
   export default defineComponent({
   export default defineComponent({
     name: 'VoiceBroadcast',
     name: 'VoiceBroadcast',
@@ -70,6 +71,7 @@
       const { hasPermission } = usePermission();
       const { hasPermission } = usePermission();
       const permissionStore = usePermissionStore();
       const permissionStore = usePermissionStore();
       const router = useRouter();
       const router = useRouter();
+      const glob = useGlobSetting();
       const list = (params) => defHttp.get({ url: '/safety/ventanalyAlarmLog/list', params });
       const list = (params) => defHttp.get({ url: '/safety/ventanalyAlarmLog/list', params });
       const cleanAlarm = () => defHttp.get({ url: '/safety/ventanalyAlarmLog/cleanAlarmLog' });
       const cleanAlarm = () => defHttp.get({ url: '/safety/ventanalyAlarmLog/cleanAlarmLog' });
       const activeKey = ref(0);
       const activeKey = ref(0);
@@ -130,8 +132,8 @@
         let userId = unref(userStore.getUserInfo).id + '?token=' + token;
         let userId = unref(userStore.getUserInfo).id + '?token=' + token;
         console.log(userStore.getUserInfo, 'userId---');
         console.log(userStore.getUserInfo, 'userId---');
         // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
         // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
-        // let url = glob.wsUrl?.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId;
-        let url = 'http://' + window.location.hostname + ':9999'?.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId;
+        // [SEC-20260913] 端点改读运行时配置 glob.wsUrl(public/js/config.js 单点),去掉 :9999 硬编码
+        let url = glob.wsUrl?.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId;
         console.log(url, 'url------');
         console.log(url, 'url------');
         connectWebSocket(url);
         connectWebSocket(url);
         onWebSocket(onWebSocketMessage);
         onWebSocket(onWebSocketMessage);

+ 4 - 1
src/layouts/default/header/components/VoiceBroadcastGsd.vue

@@ -47,6 +47,7 @@
   import dayjs from 'dayjs';
   import dayjs from 'dayjs';
 
 
   import { useDrag } from '@/hooks/event/useDrag';
   import { useDrag } from '@/hooks/event/useDrag';
+  import { useGlobSetting } from '/@/hooks/setting';
   export default defineComponent({
   export default defineComponent({
     name: 'VoiceBroadcast',
     name: 'VoiceBroadcast',
     components: { SoundOutlined, ClearOutlined, BellOutlined, WarningOutlined, CloseOutlined },
     components: { SoundOutlined, ClearOutlined, BellOutlined, WarningOutlined, CloseOutlined },
@@ -58,6 +59,7 @@
       const { hasPermission } = usePermission();
       const { hasPermission } = usePermission();
       const permissionStore = usePermissionStore();
       const permissionStore = usePermissionStore();
       const router = useRouter();
       const router = useRouter();
+      const glob = useGlobSetting();
       const activeKey = ref(0);
       const activeKey = ref(0);
       const isShowWarningBroad = ref(false);
       const isShowWarningBroad = ref(false);
       const isBroad = ref(false);
       const isBroad = ref(false);
@@ -99,7 +101,8 @@
         // let userId = unref(userStore.getUserInfo).id + '_' + wsClientId;
         // let userId = unref(userStore.getUserInfo).id + '_' + wsClientId;
         let userId = unref(userStore.getUserInfo).id + '?token=' + token;
         let userId = unref(userStore.getUserInfo).id + '?token=' + token;
         // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
         // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
-        let url = 'http://' + window.location.hostname + ':9999'?.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId;
+        // [SEC-20260913] 端点改读运行时配置 glob.wsUrl(public/js/config.js 单点),去掉 :9999 硬编码
+        let url = glob.wsUrl?.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId;
         connectWebSocket(url);
         connectWebSocket(url);
         onWebSocket(onWebSocketMessage);
         onWebSocket(onWebSocketMessage);
       }
       }

+ 3 - 3
src/views/vent/home/configurable/configurable.data.ts

@@ -6510,7 +6510,7 @@ export const testConfigVent182: Config[] = [
       background: {
       background: {
         show: true,
         show: true,
         type: 'video',
         type: 'video',
-        link: 'http://182.92.126.35:8092/modelreq/sys/common/static/webfile/mainFan.mp4',
+        link: '/modelreq/sys/common/static/webfile/mainFan.mp4',
       },
       },
       layout: {
       layout: {
         direction: 'column',
         direction: 'column',
@@ -6581,7 +6581,7 @@ export const testConfigVent182: Config[] = [
       background: {
       background: {
         show: true,
         show: true,
         type: 'video',
         type: 'video',
-        link: 'http://182.92.126.35:8092/modelreq/sys/common/static/webfile/fanLocal.mp4',
+        link: '/modelreq/sys/common/static/webfile/fanLocal.mp4',
       },
       },
       layout: {
       layout: {
         direction: 'column',
         direction: 'column',
@@ -6652,7 +6652,7 @@ export const testConfigVent182: Config[] = [
       background: {
       background: {
         show: true,
         show: true,
         type: 'video',
         type: 'video',
-        link: 'http://182.92.126.35:8092/modelreq/sys/common/static/webfile/gate.mp4',
+        link: '/modelreq/sys/common/static/webfile/gate.mp4',
       },
       },
       layout: {
       layout: {
         direction: 'row',
         direction: 'row',

+ 2 - 1
src/views/vent/monitorManager/comment/components/reportInfo.vue

@@ -38,7 +38,8 @@
     },
     },
   });
   });
 
 
-  const remoteUrl = import.meta.env.DEV ? 'http://182.92.126.35' : 'http://' + window.location.hostname;
+  // [SEC-20260913] 去掉 DEV 分支硬编码 IP,统一按当前主机名取(与生产一致)
+  const remoteUrl = 'http://' + window.location.hostname;
   const userStore = useUserStore(); //获取用户信息
   const userStore = useUserStore(); //获取用户信息
   let userId = unref(userStore.getUserInfo).id;
   let userId = unref(userStore.getUserInfo).id;
   let userName = unref(userStore.getUserInfo).username;
   let userName = unref(userStore.getUserInfo).username;

+ 2 - 1
src/views/vent/monitorManager/gateMonitor/components/CarDamageTable.vue

@@ -98,7 +98,8 @@
       pageNo: pagination.current,
       pageNo: pagination.current,
       pageSize: pagination.pageSize,
       pageSize: pagination.pageSize,
     });
     });
-    const remoteUrl = import.meta.env.DEV ? 'http://182.92.126.35' : 'http://' + window.location.hostname;
+    // [SEC-20260913] 去掉 DEV 分支硬编码 IP,统一按当前主机名取(与生产一致)
+    const remoteUrl = 'http://' + window.location.hostname;
     dataSource.value = res.records.map((el) => {
     dataSource.value = res.records.map((el) => {
       return {
       return {
         photoC: `${remoteUrl}:9999/sys/common/static/${el.photo.substring(el.photo.indexOf('/gate_monitor'))}`,
         photoC: `${remoteUrl}:9999/sys/common/static/${el.photo.substring(el.photo.indexOf('/gate_monitor'))}`,

+ 0 - 1
src/views/vent/performance/comment/CADModal.vue

@@ -69,7 +69,6 @@
     // } else {
     // } else {
     //   // 当以 iframe 模式运行时,origin 在生产模式下需要指向本项目公司端所部署的地址
     //   // 当以 iframe 模式运行时,origin 在生产模式下需要指向本项目公司端所部署的地址
     //   const origin = import.meta.env.PROD ? 'http://10.248.235.101:8092' : window.location.origin;
     //   const origin = import.meta.env.PROD ? 'http://10.248.235.101:8092' : window.location.origin;
-    //   // const origin = import.meta.env.DEV ? 'http://182.92.126.35:8092' : window.location.origin;
     //   iframesrc.value = getUrl(`${origin}/fileManager/cad-viewer`, {
     //   iframesrc.value = getUrl(`${origin}/fileManager/cad-viewer`, {
     //     // [SKIP_SSO_URL_QUERY.key]: SKIP_SSO_URL_QUERY.val,
     //     // [SKIP_SSO_URL_QUERY.key]: SKIP_SSO_URL_QUERY.val,
     //     id: record.id,
     //     id: record.id,

+ 2 - 1
src/views/vent/performance/comment/DeviceModal.vue

@@ -40,7 +40,8 @@
   console.log(userId, '用户id');
   console.log(userId, '用户id');
   console.log(userName, '用户名');
   console.log(userName, '用户名');
   const record = reactive({ strtype: '', strname: '' });
   const record = reactive({ strtype: '', strname: '' });
-  const remoteUrl = import.meta.env.DEV ? 'http://182.92.126.35' : 'http://' + window.location.hostname;
+  // [SEC-20260913] 去掉 DEV 分支硬编码 IP,统一按当前主机名取(与生产一致)
+  const remoteUrl = 'http://' + window.location.hostname;
   //表单赋值
   //表单赋值
   const [registerModal, { setModalProps }] = useModalInner(async (data) => {
   const [registerModal, { setModalProps }] = useModalInner(async (data) => {
     //重置表单
     //重置表单

+ 2 - 1
src/views/vent/reportManager/comment/DeviceModal.vue

@@ -121,7 +121,8 @@
       default: '',
       default: '',
     },
     },
   });
   });
-  const remoteUrl = import.meta.env.DEV ? 'http://182.92.126.35' : 'http://' + window.location.hostname;
+  // [SEC-20260913] 去掉 DEV 分支硬编码 IP,统一按当前主机名取(与生产一致)
+  const remoteUrl = 'http://' + window.location.hostname;
   const userStore = useUserStore(); //获取用户信息
   const userStore = useUserStore(); //获取用户信息
   let userId = unref(userStore.getUserInfo).id;
   let userId = unref(userStore.getUserInfo).id;
   let userName = unref(userStore.getUserInfo).username;
   let userName = unref(userStore.getUserInfo).username;