Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-CloudComputing
/
D_Team_Khuloud
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Hong
2020-06-08 02:53:51 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8edf701238d8d8e31c000bdc1f91517c955db71a
8edf7012
1 parent
8098cef0
파일뷰수정
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
backend/routes/folders.js
front-end/src/components/FileList.vue
backend/routes/folders.js
View file @
8edf701
...
...
@@ -33,7 +33,7 @@ router.get('/show', function(req, res, next) {
connection
.
query
(
checkfolder
,
[
curPath
,
user_id
],
function
(
err
,
rows
,
fields
)
{
if
(
err
)
{
console
.
log
(
'select error'
);
res
.
status
(
40
4
).
send
()
res
.
status
(
40
0
).
send
({
err
:
err
});
}
else
{
res
.
status
(
200
).
send
({
folders
:
rows
,
...
...
@@ -62,12 +62,13 @@ router.post('/makefolder', function(req, res, next) {
console
.
log
(
req
.
body
)
connection
.
query
(
checksql
,
[
cur
,
folder_name
],
function
(
err
,
rows
,
fields
)
{
if
(
err
)
{
res
.
status
(
400
).
send
({
err
:
err
});
}
else
{
if
(
rows
.
length
==
0
)
{
s3
.
putObject
(
params
,
function
(
err
,
data
)
{
if
(
err
)
{
console
.
log
(
's3 error'
);
res
.
status
(
400
).
send
({
err
:
err
});
}
else
{
console
.
log
(
data
);
let
sql
=
'INSERT INTO folders (folder_name,location,user_id,created) values (?,?,?,?);'
;
...
...
@@ -75,7 +76,7 @@ router.post('/makefolder', function(req, res, next) {
connection
.
query
(
sql
,
values
,
function
(
err
,
result
,
field
)
{
if
(
err
)
{
console
.
log
(
'insert error'
);
throw
err
;
res
.
status
(
400
).
send
({
err
:
err
})
;
}
else
{
let
checkfolder
=
'SELECT * FROM folders WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
checkfolder
,
[
cur
,
user_id
],
function
(
err
,
rows
,
fields
)
{
...
...
@@ -116,13 +117,13 @@ router.post('/delfolder', function(req, res, next) {
s3
.
deleteObject
(
params
,
function
(
err
,
data
)
{
if
(
err
)
{
console
.
log
(
's3 error'
);
//throw err
;
res
.
status
(
400
).
send
({
err
:
err
})
;
}
else
{
console
.
log
(
data
);
let
sql
=
'DELETE FROM folders WHERE location = ? AND folder_name = ? AND user_id = ?;'
;
connection
.
query
(
sql
,
values
,
function
(
err
,
result
,
field
)
{
if
(
err
)
{
//throw err
;
res
.
status
(
400
).
send
({
err
:
err
})
;
}
else
{
console
.
log
(
cur
);
console
.
log
(
user_id
);
...
...
front-end/src/components/FileList.vue
View file @
8edf701
...
...
@@ -248,11 +248,14 @@ export default {
cur: this.$store.state.cur + move_folder_name + '/',
};
const response = await folder(curData);
const file_response = await file(curData);
console.log(response.data);
this.$store.commit('setFolder', response.data.folders);
this.$store.commit('setFile', file_response.data.files);
this.$store.commit('setCur', response.data.cur);
this.$store.commit('setParent', response.data.parentPath);
this.folders = this.$store.getters.folderL;
this.files = this.$store.getters.fileL;
} catch (error) {
console.log('에러');
console.log(error.response.data);
...
...
@@ -265,11 +268,14 @@ export default {
cur: this.$store.state.parent,
};
const response = await folder(cData);
const file_response = await file(cData);
console.log(response.data);
this.$store.commit('setFolder', response.data.folders);
this.$store.commit('setFile', file_response.data.files);
this.$store.commit('setCur', response.data.cur);
this.$store.commit('setParent', response.data.parentPath);
this.folders = this.$store.getters.folderL;
this.files = this.$store.getters.fileL;
} catch (error) {
console.log('에러');
console.log(error.response.data);
...
...
Please
register
or
login
to post a comment