修复编辑文件时前端缓存的问题

This commit is contained in:
dushixiang 2021-10-31 20:53:56 +08:00
parent 47d0a8cc7a
commit 5546ebea86

View File

@ -328,7 +328,7 @@ class FileSystem extends Component {
showEditor = async (name, key) => {
message.loading({key: key, content: 'Loading'})
let fileContent = await request.get(`${server}/${this.state.storageType}/${this.state.storageId}/download?file=${window.encodeURIComponent(key)}`);
let fileContent = await request.get(`${server}/${this.state.storageType}/${this.state.storageId}/download?file=${window.encodeURIComponent(key)}&t=${new Date().getTime()}`);
this.setState({
currentFileKey: key,
fileName: name,
@ -508,7 +508,7 @@ class FileSystem extends Component {
编辑
</Button>
<Button type="link" size='small' disabled={disableDownload} onClick={async () => {
download(`${server}/${this.state.storageType}/${this.state.storageId}/download?file=${window.encodeURIComponent(item['key'])}&X-Auth-Token=${getToken()}`);
download(`${server}/${this.state.storageType}/${this.state.storageId}/download?file=${window.encodeURIComponent(item['key'])}&X-Auth-Token=${getToken()}&t=${new Date().getTime()}`);
}}>
下载
</Button>