Merge branch 'master' of http://khuhub.khu.ac.kr/2020-1-CloudComputing/D_Team_Khuloud
Showing
2 changed files
with
26 additions
and
3 deletions
... | @@ -20,13 +20,21 @@ router.get('/show', function(req, res, next) { | ... | @@ -20,13 +20,21 @@ router.get('/show', function(req, res, next) { |
20 | folders = {} | 20 | folders = {} |
21 | let checkfolder = 'SELECT * FROM folders WHERE location = ? AND user_id = ?;'; | 21 | let checkfolder = 'SELECT * FROM folders WHERE location = ? AND user_id = ?;'; |
22 | connection.query(checkfolder, [curPath, user_id], function(err, rows, fields) { | 22 | connection.query(checkfolder, [curPath, user_id], function(err, rows, fields) { |
23 | + if (err) { | ||
24 | + console.log('select error'); | ||
25 | + res.status(404).send() | ||
26 | + } else { | ||
23 | if (rows.length != 0) { | 27 | if (rows.length != 0) { |
24 | res.status(200).send({ | 28 | res.status(200).send({ |
25 | folders: rows, | 29 | folders: rows, |
26 | cur: curPath | 30 | cur: curPath |
27 | }) | 31 | }) |
28 | } else { | 32 | } else { |
29 | - res.send({ error: "Does not exist" }); | 33 | + res.status(200).send({ |
34 | + folders: rows, | ||
35 | + cur: curPath | ||
36 | + }) | ||
37 | + } | ||
30 | } | 38 | } |
31 | }); | 39 | }); |
32 | }); | 40 | }); | ... | ... |
... | @@ -17,7 +17,7 @@ | ... | @@ -17,7 +17,7 @@ |
17 | <v-list-item | 17 | <v-list-item |
18 | v-for="item in this.$store.getters.folderL" | 18 | v-for="item in this.$store.getters.folderL" |
19 | :key="item.title" | 19 | :key="item.title" |
20 | - @click="$router.push({name: 'Folder'})" | 20 | + @click="moveF(item.folder_name)" |
21 | > | 21 | > |
22 | <v-list-item-avatar> | 22 | <v-list-item-avatar> |
23 | <v-icon>mdi-folder</v-icon> | 23 | <v-icon>mdi-folder</v-icon> |
... | @@ -142,7 +142,7 @@ import { folder, makeFolder } from '../api/index'; | ... | @@ -142,7 +142,7 @@ import { folder, makeFolder } from '../api/index'; |
142 | try { | 142 | try { |
143 | const curData = { | 143 | const curData = { |
144 | id : this.$store.state.id, | 144 | id : this.$store.state.id, |
145 | - cur: this.$store.state.cur | 145 | + cur: '/' |
146 | } | 146 | } |
147 | const response = await folder(curData); | 147 | const response = await folder(curData); |
148 | console.log(response); | 148 | console.log(response); |
... | @@ -175,6 +175,21 @@ import { folder, makeFolder } from '../api/index'; | ... | @@ -175,6 +175,21 @@ import { folder, makeFolder } from '../api/index'; |
175 | this.initFolderName(); | 175 | this.initFolderName(); |
176 | this.dialog = false; | 176 | this.dialog = false; |
177 | } | 177 | } |
178 | + }, | ||
179 | + async moveF(move_folder_name){ | ||
180 | + try { | ||
181 | + const curData = { | ||
182 | + id : this.$store.state.id, | ||
183 | + cur: this.$store.state.cur + move_folder_name + '/' | ||
184 | + } | ||
185 | + const response = await folder(curData); | ||
186 | + console.log(response); | ||
187 | + this.$store.commit('setFolder', response.data.folders); | ||
188 | + this.$store.commit('setCur', response.data.cur); | ||
189 | + } catch (error) { | ||
190 | + console.log("에러"); | ||
191 | + console.log(error.response.data); | ||
192 | + } | ||
178 | } | 193 | } |
179 | 194 | ||
180 | } | 195 | } | ... | ... |
-
Please register or login to post a comment