F 修复文件管理器错误

pull/103/head
vapao 2020-05-29 10:00:18 +08:00
parent dacb0f55ee
commit 4fdafabbed
2 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ class ObjectView(View):
Argument('file', help='请输入文件路径')
).parse(request.GET)
if error is None:
host = Host.objects.filter(pk=1).first()
host = Host.objects.filter(pk=form.id).first()
if not host:
return json_response(error='未找到指定主机')
filename = os.path.basename(form.file)

View File

@ -83,7 +83,7 @@ class FileManager extends React.Component {
fetchFiles = () => {
this.setState({fetching: true});
const path = '/' + this.state.pwd.join('/');
http.get('/api/file/', {params: {id: 1, path}})
http.get('/api/file/', {params: {id: this.id, path}})
.then(res => {
const objects = lds.orderBy(res, [this._kindSort, 'name'], ['desc', 'asc']);
this.setState({objects})