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-10 21:21:51 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3e2953434ff545119fd0412145bb24ca328ce6f1
3e295343
1 parent
1abacfd6
.
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
12 deletions
backend/routes/folders.js
front-end/src/components/TrashList.vue
front-end/src/store/index.js
backend/routes/folders.js
View file @
3e29534
...
...
@@ -140,8 +140,8 @@ router.post('/makefolder', function(req, res, next) {
console
.
log
(
'insert error'
);
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
)
{
let
checkfolder
=
'SELECT * FROM folders WHERE location = ? AND user_id = ?
AND folder_name != ?
;'
;
connection
.
query
(
checkfolder
,
[
cur
,
user_id
,
'trashcan'
],
function
(
err
,
rows
,
fields
)
{
console
.
log
(
rows
);
res
.
status
(
200
).
send
({
folders
:
rows
...
...
@@ -198,8 +198,8 @@ router.post('/delfolder', function(req, res, next) {
console
.
log
(
"updatesql error"
);
res
.
status
(
304
).
send
({
error
:
"updatesql error"
});
}
else
{
let
resultsql
=
'SELECT * FROM folders WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
resultsql
,
[
cur
,
user_id
],
function
(
err
,
rows
,
fields
)
{
let
resultsql
=
'SELECT * FROM folders WHERE location = ? AND user_id = ?
AND folder_name != ?
;'
;
connection
.
query
(
resultsql
,
[
cur
,
user_id
,
'trashcan'
],
function
(
err
,
rows
,
fields
)
{
res
.
status
(
200
).
send
({
folders
:
rows
});
...
...
@@ -268,8 +268,8 @@ router.post('/move', function(req, res, next) {
console
.
log
(
"updatesql error"
);
res
.
status
(
304
).
send
({
error
:
"updatesql error"
});
}
else
{
let
resultsql
=
'SELECT * FROM folders WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
resultsql
,
[
cur
,
user_id
],
function
(
err
,
rows
,
fields
)
{
let
resultsql
=
'SELECT * FROM folders WHERE location = ? AND user_id = ?
AND folder_name != ?
;'
;
connection
.
query
(
resultsql
,
[
cur
,
user_id
,
'trashcan'
],
function
(
err
,
rows
,
fields
)
{
res
.
status
(
200
).
send
({
folders
:
rows
});
...
...
@@ -317,10 +317,10 @@ router.post('/move', function(req, res, next) {
if
(
err3
)
{
res
.
status
(
304
).
send
({
error
:
"updatesql error"
});
}
else
{
let
resultsql
=
'SELECT * FROM f
older
s WHERE location = ? AND user_id = ?;'
;
let
resultsql
=
'SELECT * FROM f
ile
s WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
resultsql
,
[
cur
,
user_id
],
function
(
err
,
rows
,
fields
)
{
res
.
status
(
200
).
send
({
f
older
s
:
rows
f
ile
s
:
rows
});
});
}
...
...
@@ -407,8 +407,8 @@ router.get('/search', function(req, res, next) {
console
.
log
(
target
);
let
folders
=
[]
let
files
=
[]
let
checkfolder
=
'SELECT * FROM folders WHERE folder_name LIKE '
+
target
+
' AND user_id = ?;'
;
connection
.
query
(
checkfolder
,
[
user_id
],
function
(
err
,
folder
,
fields
)
{
let
checkfolder
=
'SELECT * FROM folders WHERE folder_name LIKE '
+
target
+
' AND user_id = ?
AND folder_name != ?
;'
;
connection
.
query
(
checkfolder
,
[
user_id
,
'trashcan'
],
function
(
err
,
folder
,
fields
)
{
console
.
log
(
folder
);
folders
.
push
(
folder
)
let
checkfile
=
'SELECT * FROM files WHERE file_name LIKE '
+
target
+
' AND user_id = ?;'
;
...
...
front-end/src/components/TrashList.vue
View file @
3e29534
...
...
@@ -69,7 +69,7 @@
</v-list>
</v-menu>
<v-menu
v-model="showMenu"
v-model="showMenu
F
"
:position-x="x"
:position-y="y"
absolute
...
...
@@ -111,6 +111,9 @@ export default {
return {
curfName: {},
showMenu: false,
search: '',
x: 0,
y: 0,
cfilename: {},
showMenuF: false,
};
...
...
@@ -126,6 +129,7 @@ export default {
try {
const id = this.$store.state.id;
const response = await showTrashcan(id);
console.log(response.data);
this.$store.commit('settrashFolderList', response.data.folders);
this.$store.commit('settrashFileList', response.data.files);
} catch (error) {
...
...
front-end/src/store/index.js
View file @
3e29534
...
...
@@ -86,7 +86,7 @@ export default new Vuex.Store({
return
state
.
trashFolderList
;
},
trashFileL
(
state
)
{
return
state
.
trashFolder
List
;
return
state
.
trashFile
List
;
},
},
});
\ No newline at end of file
...
...
Please
register
or
login
to post a comment