Merge pull request #234 from jamebal/bug
fix: 修复部分时候打开office文件提示无法保存的问题或者私密分享的office文件提示乱码的问题
This commit is contained in:
commit
5a354dd18a
61
src/components/SearchDialog/index.vue
Normal file
61
src/components/SearchDialog/index.vue
Normal file
@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog style="{'font-weight': 600}" :visible.sync="searchDialogVisible" @close="searchDialogClose">
|
||||
<div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import IconFile from "@/components/Icon/IconFile";
|
||||
import Icon from "@/components/Icon/Icon.vue";
|
||||
|
||||
|
||||
export default {
|
||||
name: "SearchDialog",
|
||||
components: {
|
||||
Icon,
|
||||
IconFile
|
||||
},
|
||||
props: {
|
||||
status: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imageUrl: `${process.env.VUE_APP_BASE_API}/view/thumbnail?jmal-token=${this.$store.state.user.token}&name=${this.$store.state.user.name}&id=`,
|
||||
audioCoverUrl: `${process.env.VUE_APP_BASE_API}/view/cover?jmal-token=${this.$store.state.user.token}&name=${this.$store.state.user.name}&id=`,
|
||||
searchDialogVisible: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
watch: {
|
||||
status(visible) {
|
||||
if (visible) {
|
||||
this.searchDialogVisible = true
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
searchDialogClose() {
|
||||
this.$emit('update:status', this.searchDialogVisible)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
>>> .el-dialog {
|
||||
max-width: 460px;
|
||||
|
||||
.el-dialog__title {
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -784,11 +784,12 @@
|
||||
<el-button type="primary" size="small" @click="deleteFile" :loading="deleteLoading">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<search-dialog :status.sync="searchDialogVisible"></search-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SearchDialog from '@/components/SearchDialog/index.vue'
|
||||
import { mapGetters, mapState } from 'vuex'
|
||||
import { formatSize, formatTime } from '@/utils/number'
|
||||
import { getElementToPageLeft } from '@/utils/dom'
|
||||
@ -822,6 +823,7 @@ import FileDetails from "@/components/preview/FileDetails.vue";
|
||||
export default {
|
||||
name: 'ShowFile',
|
||||
components: {
|
||||
SearchDialog,
|
||||
FileDetails,
|
||||
TagDialog,
|
||||
ShareDialog,
|
||||
@ -1091,6 +1093,7 @@ export default {
|
||||
selectDeleteFile: [], // 选中的删除文件
|
||||
deleteLoading: false, // 删除loading
|
||||
debounceSearch: null,// 搜索防抖
|
||||
searchDialogVisible: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -1381,6 +1384,14 @@ export default {
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
// ctrl + P / cmd + P
|
||||
if (this.isCmd && keyCode === 80) {
|
||||
if (!this.inputting && this.editingIndex === -1) {
|
||||
this.searchDialogVisible = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
},
|
||||
keyup(event) {
|
||||
const isMac = navigator.platform.startsWith('Mac')
|
||||
@ -2741,8 +2752,7 @@ export default {
|
||||
this.vmode
|
||||
}&path=${path}${keyword}${searchOpenFolder}${queryTagId}${basePath}${folder}`
|
||||
)
|
||||
api
|
||||
.searchFile({
|
||||
api.searchFile({
|
||||
userId: this.$store.state.user.userId,
|
||||
username: this.$store.state.user.name,
|
||||
keyword: key,
|
||||
@ -2757,11 +2767,12 @@ export default {
|
||||
pageIndex: this.pagination.pageIndex,
|
||||
pageSize: this.pagination.pageSize,
|
||||
showFolderSize: localStorage.getItem('showFolderSize'),
|
||||
})
|
||||
.then(res => {
|
||||
}).then(res => {
|
||||
this.loadData(res, onLoad)
|
||||
this.listModeSearch = true
|
||||
this.listModeSearchOpenDir = false
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
} else {
|
||||
if (this.listModeSearch) {
|
||||
@ -2800,7 +2811,9 @@ export default {
|
||||
this.loadData(res, onLoad)
|
||||
this.listModeSearch = true
|
||||
this.listModeSearchOpenDir = fileId
|
||||
})
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
openDir(row, onLoad) {
|
||||
this.beforeLoadData(onLoad)
|
||||
@ -2817,6 +2830,8 @@ export default {
|
||||
})
|
||||
.then(res => {
|
||||
this.loadData(res, onLoad)
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
// this.path = row.path + row.name
|
||||
// this.path = this.path.replace(/\\/g, '/')
|
||||
@ -2856,7 +2871,9 @@ export default {
|
||||
})
|
||||
.then(res => {
|
||||
this.loadData(res, onLoad)
|
||||
})
|
||||
}).catch(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
getQueryPath() {
|
||||
|
||||
@ -206,6 +206,12 @@ const actions = {
|
||||
})
|
||||
},
|
||||
|
||||
// update token
|
||||
setToken({ commit }, jmalToken) {
|
||||
commit('SET_TOKEN', jmalToken)
|
||||
console.log('jmalToken', jmalToken)
|
||||
},
|
||||
|
||||
// remove share token
|
||||
resetShareToken({ commit }) {
|
||||
return new Promise(resolve => {
|
||||
|
||||
@ -79,6 +79,10 @@ service.interceptors.response.use(
|
||||
location.reload()
|
||||
})
|
||||
})
|
||||
} else {
|
||||
store.dispatch('user/resetToken').then(() => {
|
||||
location.reload()
|
||||
})
|
||||
}
|
||||
}, 200)
|
||||
} else {
|
||||
@ -90,6 +94,9 @@ service.interceptors.response.use(
|
||||
}
|
||||
return Promise.reject()
|
||||
} else {
|
||||
if (response.headers['jmal-token']) {
|
||||
store.dispatch('user/setToken', response.headers['jmal-token'])
|
||||
}
|
||||
let message = ''
|
||||
if (res.message) {
|
||||
message = res.message.toString()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user