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 18:10:49 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d2ea4c60b6394df86d379fa021ec29a036e5dec3
d2ea4c60
1 parent
ec5658f9
delete folder
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
2 deletions
front-end/src/api/index.js
front-end/src/components/FileList.vue
front-end/src/api/index.js
View file @
d2ea4c6
...
...
@@ -27,4 +27,8 @@ function makeFolder(folderData) {
return
axios
.
post
(
'/api/folder/makefolder'
,
folderData
);
}
export
{
registerUser
,
loginUser
,
folder
,
makeFolder
};
\ No newline at end of file
function
deleteFolder
(
folderData
){
return
axios
.
post
(
'/api/folder/delfolder'
,
folderData
);
}
export
{
registerUser
,
loginUser
,
folder
,
makeFolder
,
deleteFolder
};
\ No newline at end of file
...
...
front-end/src/components/FileList.vue
View file @
d2ea4c6
...
...
@@ -14,6 +14,7 @@
</v-toolbar>
<v-list two-line subheader>
<v-subheader inset>Folders</v-subheader>
<v-btn @click="moveParent">...</v-btn>
<v-list-item
v-for="item in this.$store.getters.folderL"
:key="item.title"
...
...
@@ -128,7 +129,8 @@
</div>
</template>
<script>
import { folder, makeFolder } from '../api/index';
import { folder, makeFolder, deleteFolder } from '../api/index';
import Axios from 'axios';
export default {
data() {
return {
...
...
@@ -194,6 +196,38 @@ import { folder, makeFolder } from '../api/index';
console.log("에러");
console.log(error.response.data);
}
},
async moveParent(){
try {
const cData = {
id : this.$store.state.id,
cur : this.$store.state.parent
};
const response= await folder(cData);
console.log(response.data);
this.$store.commit('setFolder', response.data.folders);
this.$store.commit('setCur', response.data.cur);
this.$store.commit('setParent', response.data.parentPath);
} catch (error) {
console.log("에러");
console.log(error.response.data);
}
},
async deleteF(folderName){
try {
const cData = {
id: this.$store.state.id,
cur : this.$store.state.cur,
folder_name: folderName
}
const reponse = await deleteFolder(cData);
console.log(response.data);
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