From 95db3ac1352e1f98ba934da9e86fca00e661abe9 Mon Sep 17 00:00:00 2001
From: zjk <852185829@qq.com>
Date: 星期五, 12 九月 2025 15:01:07 +0800
Subject: [PATCH] feat: IP地址判断

---
 laboratory/src/views/deliveryAssessment/testingAndEvaluation/components/approval/index.vue |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/laboratory/src/views/deliveryAssessment/testingAndEvaluation/components/approval/index.vue b/laboratory/src/views/deliveryAssessment/testingAndEvaluation/components/approval/index.vue
index a7bf0e6..2d7b534 100644
--- a/laboratory/src/views/deliveryAssessment/testingAndEvaluation/components/approval/index.vue
+++ b/laboratory/src/views/deliveryAssessment/testingAndEvaluation/components/approval/index.vue
@@ -55,9 +55,8 @@
                                 </div>
                             </div>
                             <el-form-item prop="name" style="margin-top: 18px">
-                                <el-upload 
-                                :on-preview="handlePreview"
-                                action="https://jsonplaceholder.typicode.com/posts/" :file-list="fileList">
+                                <el-upload :on-preview="handlePreview"
+                                    action="https://jsonplaceholder.typicode.com/posts/" :file-list="fileList">
                                     <!-- <el-button size="small" type="primary">点击上传</el-button> -->
                                 </el-upload>
                             </el-form-item>
@@ -111,6 +110,7 @@
 import AiEditor from '@/components/AiEditor'
 import { getDetailInfo, getDetail, detailAuditReport } from '../../service'
 import apiConfig from '@/utils/baseurl';
+import { getAllocateIp } from '@/utils/utils'
 export default {
     name: "ApprovalDialog",
     components: {
@@ -173,10 +173,10 @@
         handlePreview(file) {
             console.log('url', file)
             if (file && file.url) {
-                if (file.url && file.url.startsWith(apiConfig.showImgUrl)) {
+                if (file.url && file.url.startsWith(getAllocateIp())) {
                     window.open(file.url, '_blank');
-                }else{
-                    let newUrl=apiConfig.showImgUrl+file.url;
+                } else {
+                    let newUrl = getAllocateIp() + file.url;
                     window.open(newUrl, '_blank');
                 }
             }

--
Gitblit v1.7.1