zhuliu 10 månader sedan
förälder
incheckning
a62df34fba

+ 10 - 0
src/api/newApi/file.js

@@ -14,5 +14,15 @@ export default {
   //获取jwt加密
   GetJWT(data){
     return axios.post('/jwt/Common/GetJWT', data)
+  },
+
+
+  //获取版本历史
+  queryFileVersion(data){
+    return axios.post('/myOnlyOffice/onlyOffice/query-file-version', data)
+  },
+  //恢复版本历史
+  queryFileVersion(data){
+    return axios.post('/myOnlyOffice/onlyOffice/restoreVersion', data)
   }
 };

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 115 - 49
src/components/VabOnlyOffice/index.vue


+ 4 - 3
src/config/index.js

@@ -1,9 +1,10 @@
 export default {
+    env:process.env.NODE_ENV,
     baseURL: "/api",
     updateTime:'2023-08-04 08:00:00',
     specialDays:['05-12','09-18','12-13'],
     host: window.location.host,
-    url:process.env.NODE_ENV === 'production' ? 'https://xsip.cn' : 'http://192.168.2.24:8080',
-    staticURL: process.env.NODE_ENV === 'production' ? 'https://xsip.cn/onlinePreview' : 'http://192.168.2.24:8012',
-    WebSocketPath: process.env.NODE_ENV === 'production' ? 'wss://xsip.cn' : 'ws://192.168.2.24:8877',
+    url:process.env.NODE_ENV === 'production' ? 'https://xsip.cn' : 'http://192.168.2.24:8803',//文件地址
+    staticURL: process.env.NODE_ENV === 'production' ? 'https://xsip.cn/onlinePreview' : 'http://192.168.2.24:8012',//在线预览
+    WebSocketPath: process.env.NODE_ENV === 'production' ? 'wss://xsip.cn' : 'ws://192.168.2.24:8877',//websocket
 }

+ 1 - 1
src/utils/constants.js

@@ -227,7 +227,7 @@ showType:[
     value:3
   },
 ],
-sourceId:process.env.NODE_ENV === 'production'?6:1,
+sourceId:6,
 
 //更新周期
 updateCycle:[

+ 13 - 2
src/views/components/onlyOffice/index.vue

@@ -7,6 +7,7 @@
 </template>
 <script>
 import vabOnlyOffice from '@/components/VabOnlyOffice/index.vue'
+import { formatDate } from "@/utils";
 export default {
     components: {
         vabOnlyOffice,
@@ -96,15 +97,25 @@ export default {
             this.option.name = this.file.title
             this.option.id = this.file.guid
             this.option.title = this.file.title
-            this.option.url = 'https://www.xsip.cn/api/fileManager/downloadFile?fileId=' + this.file.guid
+            this.option.url = this.$c.url+ (this.$c.env=='production'?'/api':'')+'/fileManager/downloadFile?fileId=' + this.file.guid
             this.option.fileType = this.file.fileType
-            this.option.key = this.file.guid
+            this.option.key = this.generateString(10)
+            this.option.created = formatDate(new Date(),'YYYY-MM-DD HH:mm:ss')
             this.$nextTick(()=>{
                 this.show = true
             })
             
             // this.option.token = optionTemp.token
         },
+        generateString(length) {
+            let result = '';
+            const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
+            const charactersLength = characters.length;
+            for (let i = 0; i < length; i++) {
+                result += characters.charAt(Math.floor(Math.random() * charactersLength));
+            }
+            return result;
+        }
     }
 }
 </script>