From ead6b9783550ec24443ababc13b690f6eadcb69f Mon Sep 17 00:00:00 2001 From: hanyuqing <1106611654@qq.com> Date: Sat, 11 Oct 2025 10:41:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gyxtp/src/view/docInfo.vue | 3 ++- ruoyi-ui/.env.development | 2 +- ruoyi-ui/.env.production | 2 +- ruoyi-ui/src/components/Editor/index.vue | 2 +- ruoyi-ui/src/components/FileUpload/index.vue | 4 ++-- ruoyi-ui/src/components/ImagePreview/index.vue | 4 ++-- ruoyi-ui/src/components/ImageUpload/index.vue | 2 +- ruoyi-ui/src/views/system/SysPoint/index.vue | 2 +- ruoyi-ui/src/views/system/create/index.vue | 6 +++--- ruoyi-ui/src/views/system/fileManage/index.vue | 16 ++++++++-------- ruoyi-ui/src/views/system/fileManage/indexNB.vue | 18 +++++++++--------- ruoyi-ui/src/views/system/relationship/index.vue | 3 ++- ruoyi-ui/src/views/system/small/index.vue | 7 ++++--- ruoyi-ui/src/views/system/user/index.vue | 2 +- ruoyi-ui/src/views/system/user/profile/userAvatar.vue | 2 +- 15 files changed, 39 insertions(+), 36 deletions(-) diff --git a/gyxtp/src/view/docInfo.vue b/gyxtp/src/view/docInfo.vue index 6da44df..eabfae4 100644 --- a/gyxtp/src/view/docInfo.vue +++ b/gyxtp/src/view/docInfo.vue @@ -808,7 +808,8 @@ export default { var kkk=lidt[a]; this.imgsList.push(kkk) }else{ - var kkk = "http://127.0.0.1:10031"+lidt[a]; + let ip=process.env.VUE_APP_IP + var kkk = "http://"+ip+lidt[a]; this.imgsList.push(kkk) } diff --git a/ruoyi-ui/.env.development b/ruoyi-ui/.env.development index 04dd1c3..f9be955 100644 --- a/ruoyi-ui/.env.development +++ b/ruoyi-ui/.env.development @@ -10,4 +10,4 @@ VUE_APP_BASE_API = '/dev-api' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true -VUE_APP_PORT=10031 +VUE_APP_IP=localhost:10031 diff --git a/ruoyi-ui/.env.production b/ruoyi-ui/.env.production index 74df527..3479196 100644 --- a/ruoyi-ui/.env.production +++ b/ruoyi-ui/.env.production @@ -7,4 +7,4 @@ ENV = 'production' # 知识图谱管理系统/生产环境 VUE_APP_BASE_API = '/prod-api' -VUE_APP_PORT=10031 +VUE_APP_IP=localhost:10031 diff --git a/ruoyi-ui/src/components/Editor/index.vue b/ruoyi-ui/src/components/Editor/index.vue index bfe3208..2df00b9 100644 --- a/ruoyi-ui/src/components/Editor/index.vue +++ b/ruoyi-ui/src/components/Editor/index.vue @@ -60,7 +60,7 @@ export default { }, data() { return { - uploadUrl:"http://localhost:10031/common/uploadNew", // 上传的图片服务器地址 + uploadUrl:"http://"+process.env.VUE_APP_IP+"/common/uploadNew", // 上传的图片服务器地址 headers: { Authorization: "Bearer " + getToken() }, diff --git a/ruoyi-ui/src/components/FileUpload/index.vue b/ruoyi-ui/src/components/FileUpload/index.vue index 9d6a907..2769766 100644 --- a/ruoyi-ui/src/components/FileUpload/index.vue +++ b/ruoyi-ui/src/components/FileUpload/index.vue @@ -72,8 +72,8 @@ export default { return { number: 0, uploadList: [], - baseUrl: "http://localhost:10031", - uploadFileUrl:"http://localhost:10031/common/upload", // 上传文件服务器地址 + baseUrl: "http://"+process.env.VUE_APP_IP, + uploadFileUrl:"http://"+process.env.VUE_APP_IP+"/common/upload", // 上传文件服务器地址 headers: { Authorization: "Bearer " + getToken(), }, diff --git a/ruoyi-ui/src/components/ImagePreview/index.vue b/ruoyi-ui/src/components/ImagePreview/index.vue index 5940383..941655e 100644 --- a/ruoyi-ui/src/components/ImagePreview/index.vue +++ b/ruoyi-ui/src/components/ImagePreview/index.vue @@ -39,7 +39,7 @@ export default { if (isExternal(real_src)) { return real_src; } - return "http://localhost:10031" + real_src; + return "http://"+process.env.VUE_APP_IP + real_src; }, realSrcList() { if (!this.src) { @@ -51,7 +51,7 @@ export default { if (isExternal(item)) { return srcList.push(item); } - return srcList.push("http://localhost:10031" + item); + return srcList.push("http://"+process.env.VUE_APP_IP + item); }); return srcList; }, diff --git a/ruoyi-ui/src/components/ImageUpload/index.vue b/ruoyi-ui/src/components/ImageUpload/index.vue index b1b7dcb..db8c896 100644 --- a/ruoyi-ui/src/components/ImageUpload/index.vue +++ b/ruoyi-ui/src/components/ImageUpload/index.vue @@ -77,7 +77,7 @@ export default { dialogVisible: false, hideUpload: false, baseUrl: process.env.VUE_APP_BASE_API, - uploadImgUrl: "http://localhost:10031/common/upload", // 上传的图片服务器地址 + uploadImgUrl: "http://"+process.env.VUE_APP_IP+"/common/upload", // 上传的图片服务器地址 headers: { Authorization: "Bearer " + getToken(), }, diff --git a/ruoyi-ui/src/views/system/SysPoint/index.vue b/ruoyi-ui/src/views/system/SysPoint/index.vue index a37d4f4..a58d291 100644 --- a/ruoyi-ui/src/views/system/SysPoint/index.vue +++ b/ruoyi-ui/src/views/system/SysPoint/index.vue @@ -186,7 +186,7 @@ export default { oprnIno: false, isUploading: false, updateSupport: 0, - url: "http://localhost:10031/system/SysPoint/insertPoint" + url: "http://"+process.env.VUE_APP_IP+"/system/SysPoint/insertPoint" }, typeOptions: [ { label: '作者', value: 'author' }, diff --git a/ruoyi-ui/src/views/system/create/index.vue b/ruoyi-ui/src/views/system/create/index.vue index 36d5e21..448abee 100644 --- a/ruoyi-ui/src/views/system/create/index.vue +++ b/ruoyi-ui/src/views/system/create/index.vue @@ -730,9 +730,9 @@ export default { // 创建 WebSocket 连接 getUserProfile().then(response => { this.userId=response.data.userId - let port=process.env.VUE_APP_PORT - console.log(port) - this.socket = new WebSocket('ws://localhost:'+port+'/api/ws?userId='+response.data.userId); // 连接到上面的服务端 + let ip=process.env.VUE_APP_IP + console.log(ip) + this.socket = new WebSocket('ws://'+ip+'/api/ws?userId='+response.data.userId); // 连接到上面的服务端 // 监听连接打开 this.socket.addEventListener('open', (event) => { console.log('WebSocket 连接已建立'); diff --git a/ruoyi-ui/src/views/system/fileManage/index.vue b/ruoyi-ui/src/views/system/fileManage/index.vue index 05afbc9..24d66f6 100644 --- a/ruoyi-ui/src/views/system/fileManage/index.vue +++ b/ruoyi-ui/src/views/system/fileManage/index.vue @@ -865,10 +865,10 @@ export default { // 设置上传的请求头部 headers: {Authorization: "Bearer " + getToken()}, // 上传的地址 - url: "http://localhost:10031/system/fileManage/uploadVideo", - url2: "http://localhost:10031", + url: "http://"+process.env.VUE_APP_IP+"/system/fileManage/uploadVideo", + url2: "http://"+process.env.VUE_APP_IP, }, - uploadImgUrl: "http://localhost:10031/common/upload1", + uploadImgUrl: "http://"+process.env.VUE_APP_IP+"/common/upload1", // uploadImgUrl:"http://127.0.0.1:10031/common/upload1", form: {}, @@ -905,7 +905,7 @@ export default { isUploading: false, updateSupport: 0, headers: {Authorization: "Bearer " + getToken()}, - url: "http://localhost:10031/system/fileManage/addFile" + url: "http://"+process.env.VUE_APP_IP+"/system/fileManage/addFile" // url: "http://127.0.0.1:10031/system/fileManage/addFile" }, upload1: { @@ -916,7 +916,7 @@ export default { isUploading: false, updateSupport: 0, headers: {Authorization: "Bearer " + getToken()}, - url: "http://localhost:10031/system/fileManage/insertRelationByFile" + url: "http://"+process.env.VUE_APP_IP+"/system/fileManage/insertRelationByFile" // url: "http://127.0.0.1:10031/system/fileManage/addFile" }, fileDocxList: [], @@ -927,7 +927,7 @@ export default { isUploading: false, updateSupport: 0, headers: {Authorization: "Bearer " + getToken()}, - url: "http://localhost:10031/system/fileManage/addFileNew" + url: "http://"+process.env.VUE_APP_IP+"/system/fileManage/addFileNew" }, relationName: "", defaultProps: { @@ -1256,7 +1256,7 @@ export default { this.loading = true; // 发送请求到后端 - this.$axios.post('http://localhost:10031/system/fileManage/exportAll', ff[n], { + this.$axios.post('http://'+process.env.VUE_APP_IP+'/system/fileManage/exportAll', ff[n], { headers: {Authorization: "Bearer " + getToken()}, }) .then((res) => { @@ -1869,7 +1869,7 @@ export default { console.log(res) this.userRemark = res.data }) - var socket = new WebSocket('ws://localhost:10031/system/websocket/1'); + var socket = new WebSocket('ws://'+process.env.VUE_APP_IP+'/system/websocket/1'); let that = this socket.onmessage = function (event) { that.upload.tip = event.data diff --git a/ruoyi-ui/src/views/system/fileManage/indexNB.vue b/ruoyi-ui/src/views/system/fileManage/indexNB.vue index 9588642..bce2d3e 100644 --- a/ruoyi-ui/src/views/system/fileManage/indexNB.vue +++ b/ruoyi-ui/src/views/system/fileManage/indexNB.vue @@ -627,10 +627,10 @@ export default { // 设置上传的请求头部 headers: {Authorization: "Bearer " + getToken()}, // 上传的地址 - url: "http://localhost:10031/system/fileManage/uploadVideo", - url2: "http://localhost:10031", + url: "http://"+process.env.VUE_APP_IP+"/system/fileManage/uploadVideo", + url2: "http://"+process.env.VUE_APP_IP, }, - uploadImgUrl: "http://localhost:10031/common/upload1", + uploadImgUrl: "http://"+process.env.VUE_APP_IP+"/common/upload1", // uploadImgUrl:"http://127.0.0.1:10031/common/upload1", form: {}, @@ -667,7 +667,7 @@ export default { isUploading: false, updateSupport: 0, headers: {Authorization: "Bearer " + getToken()}, - url: "http://localhost:10031/system/fileManage/addFile" + url: "http://"+process.env.VUE_APP_IP+"/system/fileManage/addFile" // url: "http://127.0.0.1:10031/system/fileManage/addFile" }, upload1: { @@ -678,7 +678,7 @@ export default { isUploading: false, updateSupport: 0, headers: {Authorization: "Bearer " + getToken()}, - url: "http://localhost:10031/system/fileManage/insertRelationByFile" + url: "http://"+process.env.VUE_APP_IP+"/system/fileManage/insertRelationByFile" // url: "http://127.0.0.1:10031/system/fileManage/addFile" }, fileDocxList: [], @@ -689,7 +689,7 @@ export default { isUploading: false, updateSupport: 0, headers: {Authorization: "Bearer " + getToken()}, - url: "http://localhost:10031/system/fileManage/addFileNew" + url: "http://"+process.env.VUE_APP_IP+"/system/fileManage/addFileNew" }, relationName: "", defaultProps: { @@ -938,7 +938,7 @@ export default { this.loading = true; // 发送请求到后端 - this.$axios.post('http://localhost:10031/system/fileManage/exportAll', ff[n], { + this.$axios.post('http://'+process.env.VUE_APP_IP+'/system/fileManage/exportAll', ff[n], { headers: {Authorization: "Bearer " + getToken()}, }) .then((res) => { @@ -1393,7 +1393,7 @@ export default { imgArr.forEach(item => { var obj = {}; // /dev-api/profile/upload/2024/08/29/0锋面气旋_20240829153841A018.mp4 - obj.url = "http://localhost:10031"+item; + obj.url = "http://"+process.env.VUE_APP_IP+item; this.fileListImgs.push(obj); this.fileListImgs1.push(item); }) @@ -1548,7 +1548,7 @@ export default { this.getFileListInfo() this.loadTemplatesFromStorage(); - var socket = new WebSocket('ws://localhost:10031/system/websocket/1'); + var socket = new WebSocket('ws://'+process.env.VUE_APP_IP+'/system/websocket/1'); let that = this socket.onmessage = function (event) { that.upload.tip = event.data diff --git a/ruoyi-ui/src/views/system/relationship/index.vue b/ruoyi-ui/src/views/system/relationship/index.vue index 9661da5..cbe0d9c 100644 --- a/ruoyi-ui/src/views/system/relationship/index.vue +++ b/ruoyi-ui/src/views/system/relationship/index.vue @@ -196,7 +196,7 @@ :on-remove="handleRemoveFile" :headers="reqHeaders" :on-success="onUploadSuccess" - action="http://localhost:10031/common/upload" + :action="actionupload" :file-list="resultFileList" class="upload-files" >
@@ -222,6 +222,7 @@ export default { name: "Relationship", data() { return { + actionupload:"http://"+process.env.VUE_APP_IP+"/common/upload", resultFileList:[], diaForm: { desc: '', diff --git a/ruoyi-ui/src/views/system/small/index.vue b/ruoyi-ui/src/views/system/small/index.vue index 4c09ef4..6949145 100644 --- a/ruoyi-ui/src/views/system/small/index.vue +++ b/ruoyi-ui/src/views/system/small/index.vue @@ -174,7 +174,7 @@ closable @close="removeTag(index)" size="small" - style="margin-right: 8px; margin-bottom: 6px;" + style="margin-right: 8px;height: 32px;line-height: 32px;" > {{ tag }} @@ -185,7 +185,7 @@ @keyup.enter.native="addTag" @blur="addTag" size="small" - style="width: 120px; margin-right: 8px;" + style="width: 180px; margin-right: 8px;" placeholder="输入后回车添加" />
@@ -200,7 +200,7 @@ :on-remove="handleRemoveFile" :headers="reqHeaders" :on-success="onUploadSuccess" - action="http://localhost:10031/common/upload" + :action="uploadAction" :file-list="resultFileList" class="upload-files" >
@@ -226,6 +226,7 @@ export default { name: "Relationship", data() { return { + uploadAction:"http://"+process.env.VUE_APP_IP+"/common/upload", inputValue: '', // 遮罩层 loading: true, diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue index 1fcf6fb..590a8da 100644 --- a/ruoyi-ui/src/views/system/user/index.vue +++ b/ruoyi-ui/src/views/system/user/index.vue @@ -311,7 +311,7 @@ export default { // 设置上传的请求头部 headers: { Authorization: "Bearer " + getToken() }, // 上传的地址 - url: "http://localhost:10031/system/user/importData" + url: "http://"+process.env.VUE_APP_IP+"/system/user/importData" }, // 查询参数 queryParams: { diff --git a/ruoyi-ui/src/views/system/user/profile/userAvatar.vue b/ruoyi-ui/src/views/system/user/profile/userAvatar.vue index fcf8ac3..2d47fde 100644 --- a/ruoyi-ui/src/views/system/user/profile/userAvatar.vue +++ b/ruoyi-ui/src/views/system/user/profile/userAvatar.vue @@ -137,7 +137,7 @@ export default { formData.append("avatarfile", data, this.options.filename); uploadAvatar(formData).then(response => { this.open = false; - this.options.img = "http://localhost:10031" + response.imgUrl; + this.options.img = "http://"+process.env.VUE_APP_IP + response.imgUrl; store.commit('SET_AVATAR', this.options.img); this.$modal.msgSuccess("修改成功"); this.visible = false;