|
@@ -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>
|