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
최동원
2020-05-28 15:47:32 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
f967452ca574208dc98c637009e50d024fd40ea6
f967452c
2 parents
133e206e
273b7fd2
Merge branch 'master' of
http://khuhub.khu.ac.kr/2020-1-CloudComputing/D_Team_Khuloud
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
8 deletions
backend/routes/folders.js
front-end/src/components/FileList.vue
backend/routes/folders.js
View file @
f967452
...
...
@@ -20,13 +20,21 @@ router.get('/show', function(req, res, next) {
folders
=
{}
let
checkfolder
=
'SELECT * FROM folders WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
checkfolder
,
[
curPath
,
user_id
],
function
(
err
,
rows
,
fields
)
{
if
(
rows
.
length
!=
0
)
{
res
.
status
(
200
).
send
({
folders
:
rows
,
cur
:
curPath
})
if
(
err
)
{
console
.
log
(
'select error'
);
res
.
status
(
404
).
send
()
}
else
{
res
.
send
({
error
:
"Does not exist"
});
if
(
rows
.
length
!=
0
)
{
res
.
status
(
200
).
send
({
folders
:
rows
,
cur
:
curPath
})
}
else
{
res
.
status
(
200
).
send
({
folders
:
rows
,
cur
:
curPath
})
}
}
});
});
...
...
front-end/src/components/FileList.vue
View file @
f967452
...
...
@@ -17,7 +17,7 @@
<v-list-item
v-for="item in this.$store.getters.folderL"
:key="item.title"
@click="
$router.push({name: 'Folder'}
)"
@click="
moveF(item.folder_name
)"
>
<v-list-item-avatar>
<v-icon>mdi-folder</v-icon>
...
...
@@ -142,7 +142,7 @@ import { folder, makeFolder } from '../api/index';
try {
const curData = {
id : this.$store.state.id,
cur:
this.$store.state.cur
cur:
'/'
}
const response = await folder(curData);
console.log(response);
...
...
@@ -175,6 +175,21 @@ import { folder, makeFolder } from '../api/index';
this.initFolderName();
this.dialog = false;
}
},
async moveF(move_folder_name){
try {
const curData = {
id : this.$store.state.id,
cur: this.$store.state.cur + move_folder_name + '/'
}
const response = await folder(curData);
console.log(response);
this.$store.commit('setFolder', response.data.folders);
this.$store.commit('setCur', response.data.cur);
} catch (error) {
console.log("에러");
console.log(error.response.data);
}
}
}
...
...
Please
register
or
login
to post a comment