Selaa lähdekoodia

上传问题,未解决

gyj 2 vuotta sitten
vanhempi
commit
197677e3c2

+ 1
- 0
.gitignore Näytä tiedosto

@@ -26,3 +26,4 @@ node_modules
26 26
 node_modules
27 27
 node_modules
28 28
 node_modules
29
+/dist

BIN
dist.zip Näytä tiedosto


+ 1
- 1
dist/index.html Näytä tiedosto

@@ -1 +1 @@
1
-<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>nouiroom</title><script defer="defer" src="/js/chunk-vendors.89f300f8.js"></script><script defer="defer" src="/js/app.1c5f71ee.js"></script><link href="/css/chunk-vendors.10dd4e95.css" rel="stylesheet"><link href="/css/app.ff48263a.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but nouiroom doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
1
+<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>nouiroom</title><script src="https://api.xayunmei.com/onlyOffice/web-apps/apps/api/documents/api.js"></script><script defer="defer" src="/js/chunk-vendors.5307e452.js"></script><script defer="defer" src="/js/app.41e65d09.js"></script><link href="/css/chunk-vendors.10dd4e95.css" rel="stylesheet"><link href="/css/app.b59bb92e.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but nouiroom doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

+ 1
- 1
public/index.html Näytä tiedosto

@@ -6,7 +6,7 @@
6 6
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
7 7
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
8 8
     <title><%= htmlWebpackPlugin.options.title %></title>
9
-    <script src="http://121.40.189.20:8899/web-apps/apps/api/documents/api.js"></script>
9
+    <!-- <script src="https://api.xayunmei.com/onlyOffice/web-apps/apps/api/documents/api.js"></script> -->
10 10
   </head>
11 11
   <body>
12 12
     <noscript>

+ 9
- 9
src/api/home.js Näytä tiedosto

@@ -1,36 +1,36 @@
1 1
 import axios from "@/utils/request";
2
-let baseUrlZc = 'https://api.xayunmei.com/zhongcaiapi';
3
-let baseUrl = 'https://api.xayunmei.com/tiaojieapi';
2
+// let baseUrlZc = 'https://api.xayunmei.com/zhongcaiapi';
3
+// let baseUrl = 'https://api.xayunmei.com/tiaojieapitest';
4 4
 // let baseUrl = 'http://172.16.1.4:6001';
5 5
 // 获取usersig
6 6
 export function getUsersig(userId) {
7 7
     let appType = sessionStorage.getItem('type');
8 8
     if (appType == 'tiaojie') {
9
-        return axios.get(`${baseUrl}/caseApplication/generateUserSign?userId=${userId}`);
9
+        return axios.get(`tiaojie/caseApplication/generateUserSign?userId=${userId}`);
10 10
     } else {
11
-        return axios.get(`${baseUrlZc}/caseApplication/generateUserSign?userId=${userId}`);
11
+        return axios.get(`zhongcai/caseApplication/generateUserSign?userId=${userId}`);
12 12
     }
13 13
 }
14 14
 // 获取房间号
15 15
 export function getRoomId(caseId) {
16 16
     let appType = sessionStorage.getItem('type');
17 17
     if (appType == 'tiaojie') {
18
-        return axios.get(`${baseUrl}/caseApplication/createRoomId?caseId=${caseId}`);
18
+        return axios.get(`tiaojie/caseApplication/createRoomId?caseId=${caseId}`);
19 19
     } else {
20
-        return axios.get(`${baseUrlZc}/caseApplication/createRoomId?caseId=${caseId}`);
20
+        return axios.get(`zhongcai/caseApplication/createRoomId?caseId=${caseId}`);
21 21
     }
22 22
 }
23 23
 // 根据案件id查询相关信息
24 24
 export function reserveConferenceList(caseId) {
25 25
     let appType = sessionStorage.getItem('type');
26 26
     if (appType == 'tiaojie') {
27
-        return axios.get(`${baseUrl}/caseApplication/reserveConferenceList?caseId=${caseId}`);
27
+        return axios.get(`tiaojie/caseApplication/reserveConferenceList?caseId=${caseId}`);
28 28
     } else {
29
-        return axios.get(`${baseUrlZc}/caseApplication/reserveConferenceList?caseId=${caseId}`);
29
+        return axios.get(`zhongcai/caseApplication/reserveConferenceList?caseId=${caseId}`);
30 30
     }
31 31
     
32 32
 }
33 33
 //根据id查询密文信息
34 34
 export function getEncryptInfoByid(caseId) {
35
-        return axios.get(`${baseUrl}/shortMessage/getMeetingInfo?authId=${caseId}`);
35
+        return axios.get(`tiaojie/shortMessage/getMeetingInfo?authId=${caseId}`);
36 36
 }

+ 20
- 16
src/api/room.js Näytä tiedosto

@@ -1,65 +1,69 @@
1 1
 import axios from "@/utils/request";
2
-let baseUrlZC = 'https://api.xayunmei.com/zhongcaiapi';
3
-let baseUrl = 'https://api.xayunmei.com/tiaojieapi';
2
+// let baseUrlZC = 'https://api.xayunmei.com/zhongcaiapi';
3
+// let baseUrl = 'https://api.xayunmei.com/tiaojieapitest';
4 4
 // let baseUrl = 'http://121.40.189.20:6001';
5 5
 // 开始云端录制
6 6
 export function startVideo(data) {
7 7
     let appType = sessionStorage.getItem('type');
8 8
     if (appType == 'tiaojie') {
9
-        return axios.post(`${baseUrl}/video/openCloudRecording`, data);
9
+        return axios.post(`tiaojie/video/openCloudRecording`, data);
10 10
     } else {
11
-        return axios.post(`${baseUrlZC}/video/openCloudRecording`, data);
11
+        return axios.post(`zhongcai/video/openCloudRecording`, data);
12 12
     }
13 13
 }
14 14
 // 结束云端录制
15 15
 export function stopVideo(data) {
16 16
     let appType = sessionStorage.getItem('type');
17 17
     if (appType == 'tiaojie') {
18
-        return axios.post(`${baseUrl}/video/closeDeleteCloudRecording?taskId=${data}`);
18
+        return axios.post(`tiaojie/video/closeDeleteCloudRecording?taskId=${data}`);
19 19
     } else {
20
-        return axios.post(`${baseUrlZC}/video/closeDeleteCloudRecording?taskId=${data}`);
20
+        return axios.post(`zhongcai/video/closeDeleteCloudRecording?taskId=${data}`);
21 21
     }
22 22
 }
23 23
 // 解散房间
24 24
 export function destructionRoom(data) {
25 25
     let appType = sessionStorage.getItem('type');
26 26
     if (appType == 'tiaojie') {
27
-        return axios.post(`${baseUrl}/video/dissolveRoom`, data);
27
+        return axios.post(`tiaojie/video/dissolveRoom`, data);
28 28
     } else {
29
-        return axios.post(`${baseUrlZC}/video/dissolveRoom`, data);
29
+        return axios.post(`zhongcai/video/dissolveRoom`, data);
30 30
     }
31 31
 }
32 32
 // 根据html字符串转pdf并且和案件关联
33 33
 export function htmlToPDF(data) {
34 34
     let appType = sessionStorage.getItem('type');
35 35
     if (appType == 'tiaojie') {
36
-        return axios.post(`${baseUrl}/video/htmlToPDF`, data);
36
+        return axios.post(`tiaojie/video/htmlToPDF`, data);
37 37
     } else {
38
-        return axios.post(`${baseUrlZC}/video/htmlToPDF`, data);
38
+        return axios.post(`zhongcai/video/htmlToPDF`, data);
39 39
     }
40 40
 }
41 41
 // 根据userId查询该用户是否是秘书
42 42
 export function secretaryRoleByUserId(userId, caseId) {
43 43
     let appType = sessionStorage.getItem('type');
44 44
     if (appType == 'tiaojie') {
45
-        return axios.get(`${baseUrl}/video/secretaryRoleByUserId?userId=${userId}&caseId=${caseId}`);
45
+        return axios.get(`tiaojie/video/secretaryRoleByUserId?userId=${userId}&caseId=${caseId}`);
46 46
     } else {
47
-        return axios.get(`${baseUrlZC}/video/secretaryRoleByUserId?userId=${userId}`);
47
+        return axios.get(`zhongcai/video/secretaryRoleByUserId?userId=${userId}`);
48 48
     }
49 49
 }
50 50
 // 获取证据列表
51 51
 export function selectById(caseId) {
52
-    return axios.get(`${baseUrl}/caseApplication/selectById?id=${caseId}`);
52
+    return axios.get(`tiaojie/caseApplication/selectById?id=${caseId}`);
53 53
 }
54 54
 // 根据案件id查询登录人是否为申请人被申请人
55 55
 export function selectRoleMenuByCaseId(caseId) {
56
-    return axios.get(`${baseUrl}/video/selectRoleMenuByCaseId?caseId=${caseId}`);
56
+    return axios.get(`tiaojie/video/selectRoleMenuByCaseId?caseId=${caseId}`);
57 57
 }
58 58
 // 保存onlyOffice文档
59 59
 export function saveOnlyOfficeFile(data) {
60
-    return axios.post(`${baseUrl}/caseApplication/saveOnlyOfficeFile`, data);
60
+    return axios.post(`tiaojie/caseApplication/saveOnlyOfficeFile`, data);
61 61
 }
62 62
 //获取当前用户的操作权限
63 63
 export function getMenuPermsByUser(caseId) {
64
-    return axios.get(`${baseUrl}/system/menu/getMenuPermsByUser`);
64
+    return axios.get(`tiaojie/system/menu/getMenuPermsByUser`);
65
+}
66
+// 上传文件
67
+export function videoUpload(data) {
68
+    return axios.post(`tiaojie/video/upload`,data);
65 69
 }

+ 6
- 6
src/router/index.js Näytä tiedosto

@@ -21,12 +21,12 @@ const routes = [
21 21
         component: () => import("../views/room.vue"),
22 22
         meta: { title: "房间" }
23 23
     },
24
-    {
25
-        path: "/onlyOffice",
26
-        name: "onlyOffice",
27
-        component: () => import("../views/onlyOffice.vue"),
28
-        meta: { title: "在线文档" }
29
-    },
24
+    // {
25
+    //     path: "/onlyOffice",
26
+    //     name: "onlyOffice",
27
+    //     component: () => import("../views/onlyOffice.vue"),
28
+    //     meta: { title: "在线文档" }
29
+    // },
30 30
     {
31 31
         path: "/test",
32 32
         name: "test",

+ 1
- 1
src/utils/request.js Näytä tiedosto

@@ -13,7 +13,7 @@ const server = axios.create({
13 13
 server.interceptors.request.use(config => {
14 14
     // config包含了请求相关的所有信息
15 15
     // 可以同过config对象给请求配置或者修改信息
16
-    config.headers.Authorization = sessionStorage.getItem('token');
16
+    config.headers.Authorization ="Bearer " + sessionStorage.getItem('token');
17 17
     return config // 将配置完成的token返回 如果不返回 请求不会继续进行
18 18
 }, err => {
19 19
     // 请求发生错误时的回调函数

+ 2
- 2
src/views/components/roomFooter.vue Näytä tiedosto

@@ -41,7 +41,7 @@
41 41
           @click="videoClickOff"
42 42
         />
43 43
       </div>
44
-      <div class="sharing">
44
+      <!-- <div class="sharing">
45 45
         <img
46 46
           class="sharImg"
47 47
           src="@/assets/screenShare_on.png"
@@ -56,7 +56,7 @@
56 56
           v-else
57 57
           @click="sharClickOff"
58 58
         />
59
-      </div>
59
+      </div> -->
60 60
     </div>
61 61
   </div>
62 62
 </template>

+ 8
- 4
src/views/home.vue Näytä tiedosto

@@ -18,11 +18,11 @@ export default {
18 18
   name: "App",
19 19
   components: {
20 20
     homepc,
21
-    homePhone
21
+    homePhone,
22 22
   },
23 23
   data() {
24 24
     return {
25
-      modileFlag: false
25
+      modileFlag: false,
26 26
     };
27 27
   },
28 28
   methods: {},
@@ -30,8 +30,12 @@ export default {
30 30
     this.modileFlag = getModile();
31 31
     let routeParams = this.$route.query;
32 32
     let appType = routeParams.type;
33
-    sessionStorage.setItem("type", appType);
34
-  }
33
+    if (appType) {
34
+      sessionStorage.setItem("type", appType);
35
+    }else{
36
+      sessionStorage.setItem("type", "tiaojie");
37
+    }
38
+  },
35 39
 };
36 40
 </script>
37 41
   

+ 1
- 0
src/views/onlyOffice.vue Näytä tiedosto

@@ -35,6 +35,7 @@ export default {
35 35
             }
36 36
             axios.get(`http://121.40.189.20:9090/onlyOfficeConfig/${edit}/${id}/${this.userId}/desktop/true`).then(res => {
37 37
                 this.config = res.data;
38
+                debugger
38 39
                 var docEditor = new DocsAPI.DocEditor("placeholder", this.config);
39 40
             })
40 41
         },

+ 69
- 13
src/views/room.vue Näytä tiedosto

@@ -71,7 +71,7 @@
71 71
           <el-upload
72 72
             ref="upload"
73 73
             :limit="1"
74
-            action="https://api.xayunmei.com/tiaojieapi/video/upload"
74
+            action="https://api.xayunmei.com/tiaojieapitest/video/upload"
75 75
             :headers="headers"
76 76
             :data="filedata"
77 77
             :on-change="beforeUpload"
@@ -87,7 +87,7 @@
87 87
             v-if="resFlag"
88 88
             ref="upload1"
89 89
             :limit="1"
90
-            action="https://api.xayunmei.com/tiaojieapi/video/upload"
90
+            action="https://api.xayunmei.com/tiaojieapitest/video/upload"
91 91
             :headers="headers1"
92 92
             :data="filedata1"
93 93
             :on-change="beforeUpload1"
@@ -99,10 +99,11 @@
99 99
             >
100 100
           </el-upload>
101 101
           <el-upload
102
-            v-if="editFlag"
102
+            v-if="updataFlag"
103 103
             ref="upload3"
104 104
             :limit="1"
105
-            action="https://api.xayunmei.com/tiaojieapi/video/upload"
105
+            action=""
106
+            :http-request="upload3"
106 107
             :headers="headers3"
107 108
             :data="filedata3"
108 109
             :on-change="beforeUpload3"
@@ -114,6 +115,7 @@
114 115
               >上传调解书</el-button
115 116
             >
116 117
           </el-upload>
118
+          <!-- https://api.xayunmei.com/tiaojieapitest/video/upload -->
117 119
         </div>
118 120
         <div class="list">
119 121
           <div class="applicant" v-if="applicantFile.length > 0">
@@ -178,6 +180,7 @@ import {
178 180
   selectById,
179 181
   selectRoleMenuByCaseId,
180 182
   getMenuPermsByUser,
183
+  videoUpload
181 184
 } from "@/api/room";
182 185
 import { getWidth, getHeight, getWidthPhone, getModile } from "@/utils/utils";
183 186
 import roomFooter from "./components/roomFooter.vue";
@@ -314,10 +317,12 @@ export default {
314 317
       this.sharFlag = true;
315 318
       this.videoList = "videoList";
316 319
       this.screenShareFlag = false;
317
-      if(this.userList.length >= 1){
320
+      if (this.userList.length > 1) {
318 321
         this.videoClass = "videoItem1";
319
-      }else{
322
+      } else if (this.userList.length < 1) {
320 323
         this.videoClass = "videoItem";
324
+      } else if (this.userList.length == 1) {
325
+        this.videoClass = "videoItem3";
321 326
       }
322 327
     },
323 328
     /**获取当前用户操作权限 */
@@ -373,15 +378,47 @@ export default {
373 378
       this.$refs.upload3.clearFiles();
374 379
       this.selectByIdFn(this.caseId);
375 380
     },
381
+    upload3(param){
382
+      const formData = new FormData()
383
+			formData.append('file', param.file);
384
+      formData.append('annexType', 7);
385
+      formData.append('officeFlag', 1);
386
+      formData.append('caseId', this.caseId);
387
+      videoUpload(formData).then(res=>{
388
+        console.log('上传图片成功')
389
+      })
390
+			// axios.post(url, formData).then(response => {
391
+			// 	//根据返回值进行判断是否上传成功
392
+			// 	if(response.data.flag){
393
+			// 		//上传成功
394
+			// 		console.log('上传图片成功')
395
+			// 	}else{
396
+			// 		//上传失败
397
+			// 		console.log('图片上传失败')
398
+			// 	}
399
+			// }).catch(response => {
400
+			// 	console.log('异常处理')
401
+			// })
402
+    },
376 403
     preview(item, flag) {
377 404
       if (item.onlyOfficeFileId) {
378
-        this.$router.push({
379
-          path: "/onlyoffice",
380
-          query: { id: item.onlyOfficeFileId, flag: flag },
381
-        });
405
+        // this.$router.push({
406
+        //   path: "/onlyoffice",
407
+        //   query: { id: item.onlyOfficeFileId, flag: flag },
408
+        // });
409
+        let flag = 1;
410
+        if(this.editFlag){
411
+          flag = 1
412
+        }else{
413
+          flag = 0
414
+        }
415
+        window.open(
416
+          `http://121.40.189.20:8002/onlyoffice?id=${item.onlyOfficeFileId}&flag=${flag}`,
417
+          "_black"
418
+        );
382 419
       } else {
383 420
         window.open(
384
-          "https://api.xayunmei.com/tiaojieapi" + item.annexPath,
421
+          "http://121.40.189.20:6001" + item.annexPath,
385 422
           "_black"
386 423
         );
387 424
       }
@@ -536,7 +573,7 @@ export default {
536 573
           this.userList.splice(deleteIndex, 1);
537 574
         }
538 575
         if (this.modileFlag) {
539
-          this.userHeight = getHeight(this.userList);
576
+          // this.userHeight = getHeight(this.userList);
540 577
         } else {
541 578
           this.userClassPhone = getWidthPhone(this.userList);
542 579
         }
@@ -575,11 +612,24 @@ export default {
575 612
       return this.$refs.myQuillEditor.quill;
576 613
     },
577 614
   },
615
+  watch: {
616
+    userList(value) {
617
+      if (value.length == 1) {
618
+        this.videoClass = "videoItem3";
619
+      } else if (value.length > 1) {
620
+        this.videoClass = "videoItem1";
621
+      } else if (value.length < 1) {
622
+        this.videoClass = "videoItem";
623
+      }
624
+    },
625
+  },
578 626
   async mounted() {
579 627
     if (this.userList.length == 1) {
580
-      this.videoClass = "videoItem";
628
+      this.videoClass = "videoItem3";
581 629
     } else if (this.userList.length > 1) {
582 630
       this.videoClass = "videoItem1";
631
+    } else if (this.userList.length < 1) {
632
+      this.videoClass = "videoItem";
583 633
     }
584 634
     // 判断设备类型
585 635
     this.modileFlag = getModile();
@@ -722,6 +772,12 @@ export default {
722 772
   background: red;
723 773
   border-radius: 20px;
724 774
 }
775
+.videoItem3 {
776
+  width: 48%;
777
+  height: 100%;
778
+  background: red;
779
+  border-radius: 20px;
780
+}
725 781
 .videoItem2 {
726 782
   width: 90%;
727 783
   height: 25%;

+ 4
- 4
src/views/testRoom.vue Näytä tiedosto

@@ -71,7 +71,7 @@
71 71
           <el-upload
72 72
             ref="upload"
73 73
             :limit="1"
74
-            action="https://api.xayunmei.com/tiaojieapi/video/upload"
74
+            action="https://api.xayunmei.com/tiaojieapitest/video/upload"
75 75
             :headers="headers"
76 76
             :data="filedata"
77 77
             :on-change="beforeUpload"
@@ -87,7 +87,7 @@
87 87
             v-if="resFlag"
88 88
             ref="upload1"
89 89
             :limit="1"
90
-            action="https://api.xayunmei.com/tiaojieapi/video/upload"
90
+            action="https://api.xayunmei.com/tiaojieapitest/video/upload"
91 91
             :headers="headers1"
92 92
             :data="filedata1"
93 93
             :on-change="beforeUpload1"
@@ -102,7 +102,7 @@
102 102
             v-if="editFlag"
103 103
             ref="upload3"
104 104
             :limit="1"
105
-            action="https://api.xayunmei.com/tiaojieapi/video/upload"
105
+            action="https://api.xayunmei.com/tiaojieapitest/video/upload"
106 106
             :headers="headers3"
107 107
             :data="filedata3"
108 108
             :on-change="beforeUpload3"
@@ -381,7 +381,7 @@ export default {
381 381
         });
382 382
       } else {
383 383
         window.open(
384
-          "https://api.xayunmei.com/tiaojieapi" + item.annexPath,
384
+          "https://api.xayunmei.com/tiaojieapitest" + item.annexPath,
385 385
           "_black"
386 386
         );
387 387
       }

+ 21
- 1
vue.config.js Näytä tiedosto

@@ -1,4 +1,24 @@
1 1
 const { defineConfig } = require('@vue/cli-service')
2 2
 module.exports = defineConfig({
3
-  transpileDependencies: true
3
+  transpileDependencies: true,
4
+  devServer: {
5
+    proxy: {
6
+      '/tiaojie': {
7
+        target: 'https://api.xayunmei.com/tiaojieapitest', // 后端服务器地址
8
+        changeOrigin: true, // 是否改变Origin头信息
9
+        secure : false,
10
+        pathRewrite: {
11
+          '^/api': '' // 将/api前缀重写为空字符串
12
+        },
13
+      },
14
+      '/zhongcai': {
15
+        target: 'https://api.xayunmei.com/zhongcaiapi', // 后端服务器地址
16
+        changeOrigin: true, // 是否改变Origin头信息
17
+        secure : false,
18
+        pathRewrite: {
19
+          '^/zhongcai': '' // 将/api前缀重写为空字符串
20
+        },
21
+      }
22
+    }
23
+  }
4 24
 })