From 04d82cec7e530a389891388de0b97681c6ed3357 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期五, 19 七月 2024 15:34:55 +0800
Subject: [PATCH] 提交

---
 .env.development                                                              |    1 +
 src/views/onlineEducation/courseManage/courseResource/componets/viewVideo.vue |    2 +-
 .env.production                                                               |    3 ++-
 src/views/components/upload.vue                                               |    6 +++---
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/.env.development b/.env.development
index 93ecf68..1da346e 100644
--- a/.env.development
+++ b/.env.development
@@ -10,6 +10,7 @@
 
 #孔哥
 VITE_APP_BASE_API = 'http://192.168.2.15:8082/api'
+VITE_APP_RESOURCE_API = 'http://192.168.2.16:9000/trainexam/'
 
 #线上
 #VITE_APP_BASE_API = 'http://106.15.95.149:8088/api'
diff --git a/.env.production b/.env.production
index 1fc68e0..d07da2b 100644
--- a/.env.production
+++ b/.env.production
@@ -5,7 +5,8 @@
 VITE_APP_ENV = 'production'
 
 # 在线教育/生产环境
-VITE_APP_BASE_API = 'http://106.15.95.149:8088/api'
+VITE_APP_BASE_API = '/api'
+VITE_APP_RESOURCE_API = 'http://47.108.222.15/'
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli
 VITE_BUILD_COMPRESS = gzip
diff --git a/src/views/components/upload.vue b/src/views/components/upload.vue
index e1563e6..b309945 100644
--- a/src/views/components/upload.vue
+++ b/src/views/components/upload.vue
@@ -83,7 +83,7 @@
         autoplay:true,//自动播放
         sources: [
           {
-            src: resourcePath.value ? "http://192.168.2.16:9000/trainexam/" + resourcePath.value : '',
+            src: resourcePath.value ? import.meta.env.VITE_APP_RESOURCE_API + resourcePath.value : '',
             // src:'',
             type: 'application/x-mpegURL',
           }
@@ -153,7 +153,7 @@
 const view = (file) => {
   console.log('vlco',file)
   // console.log("点击文件=>", file);
-  const url = 'http://192.168.2.16:9000/trainexam/' + file.path;
+  const url = import.meta.env.VITE_APP_RESOURCE_API + file.path;
   const link = document.createElement("a");
   link.href = url;
   link.download = file.name;
@@ -457,7 +457,7 @@
         console.log("myPlayer.value",myPlayer.value)
         myPlayer.value.src(
             {
-              src:"http://192.168.2.16:9000/trainexam/"+data.data.path,
+              src: import.meta.env.VITE_APP_RESOURCE_API +data.data.path,
               type: 'application/x-mpegURL',
             })
         //   myPlayer.value.load()
diff --git a/src/views/onlineEducation/courseManage/courseResource/componets/viewVideo.vue b/src/views/onlineEducation/courseManage/courseResource/componets/viewVideo.vue
index 625ac92..e527d51 100644
--- a/src/views/onlineEducation/courseManage/courseResource/componets/viewVideo.vue
+++ b/src/views/onlineEducation/courseManage/courseResource/componets/viewVideo.vue
@@ -42,7 +42,7 @@
         autoplay:true,//自动播放
         sources: [
           {
-            src: resourcePath.value ? "http://192.168.2.16:9000/trainexam/" + resourcePath.value : '',
+            src: resourcePath.value ? import.meta.env.VITE_APP_RESOURCE_API + resourcePath.value : '',
             // src:'',
             type: 'application/x-mpegURL',
           }

--
Gitblit v1.9.2