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-05-28 15:45:28 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
efdbda4514a479c67876224528f09c04f98a9652
efdbda45
1 parent
677e924e
폴더이동
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 @
efdbda4
...
...
@@ -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 @
efdbda4
...
...
@@ -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>
...
...
@@ -139,7 +139,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);
...
...
@@ -172,6 +172,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