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-08 05:01:29 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e4fae9f8c727ba29fa5a099c04c73f4549969bf9
e4fae9f8
1 parent
091eeaa9
파일이동즐겨찾기
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
backend/routes/favorites.js
backend/routes/folders.js
front-end/src/components/FileList.vue
backend/routes/favorites.js
View file @
e4fae9f
...
...
@@ -139,7 +139,7 @@ router.post('/delfile', function(req, res, next) {
let
cur
=
req
.
body
.
cur
;
let
checkfile
=
'SELECT * FROM files WHERE location = ? AND user_id = ? AND file_name = ? AND favorite = 1;'
;
connection
.
query
(
checkfile
,
[
cur
,
user_id
,
file_name
],
function
(
err
,
rows
,
fields
)
{
connection
.
query
(
checkfile
,
[
cur
,
user_id
,
file_name
],
function
(
err
,
rows
,
fields
)
{
if
(
err
)
{
console
.
log
(
'select error'
);
res
.
status
(
400
).
send
({
error
:
err
});
...
...
@@ -151,8 +151,8 @@ router.post('/delfile', function(req, res, next) {
console
.
log
(
'update error'
);
res
.
status
(
400
).
send
({
error
:
err
});
}
else
{
let
getf
older
=
'SELECT * FROM files WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
getf
older
,
[
cur
,
user_id
],
function
(
err
,
files
,
fields
)
{
let
getf
ile
=
'SELECT * FROM files WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
getf
ile
,
[
cur
,
user_id
],
function
(
err
,
files
,
fields
)
{
res
.
status
(
200
).
send
({
files
:
files
})
...
...
backend/routes/folders.js
View file @
e4fae9f
...
...
@@ -154,7 +154,7 @@ router.post('/move', function(req, res, next) {
curPath
=
user_id
+
cur
;
let
name
=
req
.
body
.
name
;
let
newPath
=
user_id
+
req
.
body
.
newPath
;
if
(
req
.
body
.
isfolder
==
'true'
)
{
if
(
req
.
body
.
isfolder
)
{
let
checkfolder
=
'SELECT * FROM folders WHERE location = ? AND folder_name = ? AND user_id = ?;'
;
connection
.
query
(
checkfolder
,
[
cur
,
name
,
user_id
],
function
(
err1
,
rows
,
fields
)
{
console
.
log
(
rows
);
...
...
front-end/src/components/FileList.vue
View file @
e4fae9f
...
...
@@ -430,7 +430,7 @@ export default {
const cData = {
id: this.$store.state.id,
cur: this.$store.state.cur,
folder_
name: this.curfName.folder_name,
name: this.curfName.folder_name,
isfolder: true,
newPath: this.$store.state.cur + folderName + '/',
};
...
...
Please
register
or
login
to post a comment