Ver Fonte

perf(views): 优化“验证设备”步骤图片地址异常问题

wangshun há 1 mês atrás
pai
commit
7ca815bc48
1 ficheiros alterados com 6 adições e 2 exclusões
  1. 6 2
      src/views/register-gateway/VerifyDevice.vue

+ 6 - 2
src/views/register-gateway/VerifyDevice.vue

@@ -88,7 +88,7 @@ const verificationGateway = () => {
 };
 
 const productManual = () => {
-  const fileUrl = 'http://192.168.1.136:9000' + props.form.docUrl; // 替换为你的文件URL
+  const fileUrl = import.meta.env.VITE_IMG_API + props.form.docUrl; // 替换为你的文件URL
   window.open(fileUrl, '_blank');
 };
 
@@ -136,6 +136,10 @@ watch(
     }
   },
 );
+
+const imgUrl = computed(() => {
+  return import.meta.env.VITE_IMG_API + props.form.iconUrl;
+});
 </script>
 
 <template>
@@ -175,7 +179,7 @@ watch(
       <ARow style="padding: 0 30px 20px">
         <ACol :span="10">
           <AFlex justify="center" style="width: 100%" :vertical="true" align="center">
-            <img class="dev-card-left-img" :src="'http://192.168.1.136:9000' + props.form.iconUrl" alt="" />
+            <img class="dev-card-left-img" :src="imgUrl" alt="" />
             <div class="dev-card-left-text1">{{ props.form.modelName }}</div>
             <div class="dev-card-left-text2">
               {{ props.form.surfMode[0] }}|{{ props.form.surfMode[1] }}|{{ props.form.surfMode[2] }}