From 4fdafabbed8e49e167e163a19b18789f518316b5 Mon Sep 17 00:00:00 2001 From: vapao Date: Fri, 29 May 2020 10:00:18 +0800 Subject: [PATCH] =?UTF-8?q?F=20=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=99=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_api/apps/file/views.py | 2 +- spug_web/src/pages/ssh/FileManager.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spug_api/apps/file/views.py b/spug_api/apps/file/views.py index 72db6d3..efb0cc6 100644 --- a/spug_api/apps/file/views.py +++ b/spug_api/apps/file/views.py @@ -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) diff --git a/spug_web/src/pages/ssh/FileManager.js b/spug_web/src/pages/ssh/FileManager.js index bbceaa2..8a02f27 100644 --- a/spug_web/src/pages/ssh/FileManager.js +++ b/spug_web/src/pages/ssh/FileManager.js @@ -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})