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-27 19:33:23 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c92dba19846c0ea78a1486c3a9bf65e8bd682934
c92dba19
1 parent
2f7e0b6f
백엔드폴더추가
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
768 additions
and
156 deletions
backend/app.js
backend/package-lock.json
backend/package.json
backend/routes/folders.js
front-end/src/api/index.js
front-end/src/components/FileList.vue
front-end/src/components/ToolView.vue
front-end/src/store/index.js
backend/app.js
View file @
c92dba1
...
...
@@ -9,6 +9,7 @@ var indexRouter = require('./routes/index');
var
userRouter
=
require
(
'./routes/userlogin/user'
);
var
loginRouter
=
require
(
'./routes/userlogin/login'
);
var
registerRouter
=
require
(
'./routes/userlogin/register'
);
var
folderRouter
=
require
(
'./routes/folders'
);
var
passport
=
require
(
'passport'
);
...
...
@@ -29,7 +30,7 @@ passport.deserializeUser(function(user, done) {
var
app
=
express
();
// view engine setup
app
.
set
(
'views'
,
[
path
.
join
(
__dirname
,
'views'
),
path
.
join
(
__dirname
,
'dist'
)]);
app
.
set
(
'views'
,
[
path
.
join
(
__dirname
,
'views'
),
path
.
join
(
__dirname
,
'dist'
)]);
// app.set('view engine', 'ejs');
app
.
use
(
logger
(
'dev'
));
...
...
@@ -54,6 +55,7 @@ app.use('/api/', indexRouter);
app
.
use
(
'/api/user'
,
userRouter
);
app
.
use
(
'/api/login'
,
loginRouter
);
app
.
use
(
'/api/RegistUser'
,
registerRouter
);
app
.
use
(
'/api/folder'
,
folderRouter
);
//app.use('/users', usersRouter);
// catch 404 and forward to error handler
...
...
backend/package-lock.json
View file @
c92dba1
...
...
@@ -46,6 +46,17 @@
}
}
},
"ajv"
:
{
"version"
:
"6.12.2"
,
"resolved"
:
"https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz"
,
"integrity"
:
"sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ=="
,
"requires"
:
{
"fast-deep-equal"
:
"^3.1.1"
,
"fast-json-stable-stringify"
:
"^2.0.0"
,
"json-schema-traverse"
:
"^0.4.1"
,
"uri-js"
:
"^4.2.2"
}
},
"align-text"
:
{
"version"
:
"0.1.4"
,
"resolved"
:
"https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz"
,
...
...
@@ -79,11 +90,55 @@
"resolved"
:
"https://registry.npmjs.org/asap/-/asap-2.0.6.tgz"
,
"integrity"
:
"sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY="
},
"asn1"
:
{
"version"
:
"0.2.4"
,
"resolved"
:
"https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz"
,
"integrity"
:
"sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg=="
,
"requires"
:
{
"safer-buffer"
:
"~2.1.0"
}
},
"assert-plus"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz"
,
"integrity"
:
"sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
},
"async"
:
{
"version"
:
"0.9.2"
,
"resolved"
:
"https://registry.npmjs.org/async/-/async-0.9.2.tgz"
,
"integrity"
:
"sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0="
},
"asynckit"
:
{
"version"
:
"0.4.0"
,
"resolved"
:
"https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz"
,
"integrity"
:
"sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"aws-sdk"
:
{
"version"
:
"2.683.0"
,
"resolved"
:
"https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.683.0.tgz"
,
"integrity"
:
"sha512-mi1175pJMbQhCWhBEQ5ccQ3SDE+SJzbapuAQtcb7tdLLV7dPKf4zQXhpqK1uG0dysm8NhsNtgxwA2diYOKWlTg=="
,
"requires"
:
{
"buffer"
:
"4.9.1"
,
"events"
:
"1.1.1"
,
"ieee754"
:
"1.1.13"
,
"jmespath"
:
"0.15.0"
,
"querystring"
:
"0.2.0"
,
"sax"
:
"1.2.1"
,
"url"
:
"0.10.3"
,
"uuid"
:
"3.3.2"
,
"xml2js"
:
"0.4.19"
}
},
"aws-sign2"
:
{
"version"
:
"0.7.0"
,
"resolved"
:
"https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz"
,
"integrity"
:
"sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
},
"aws4"
:
{
"version"
:
"1.10.0"
,
"resolved"
:
"https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz"
,
"integrity"
:
"sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA=="
},
"babel-runtime"
:
{
"version"
:
"6.26.0"
,
"resolved"
:
"https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz"
,
...
...
@@ -114,6 +169,11 @@
"resolved"
:
"https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz"
,
"integrity"
:
"sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
},
"base64-js"
:
{
"version"
:
"1.3.1"
,
"resolved"
:
"https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz"
,
"integrity"
:
"sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g=="
},
"basic-auth"
:
{
"version"
:
"2.0.1"
,
"resolved"
:
"https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz"
,
...
...
@@ -122,6 +182,14 @@
"safe-buffer"
:
"5.1.2"
}
},
"bcrypt-pbkdf"
:
{
"version"
:
"1.0.2"
,
"resolved"
:
"https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz"
,
"integrity"
:
"sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4="
,
"requires"
:
{
"tweetnacl"
:
"^0.14.3"
}
},
"bignumber.js"
:
{
"version"
:
"9.0.0"
,
"resolved"
:
"https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz"
,
...
...
@@ -153,6 +221,16 @@
"concat-map"
:
"0.0.1"
}
},
"buffer"
:
{
"version"
:
"4.9.1"
,
"resolved"
:
"https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz"
,
"integrity"
:
"sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg="
,
"requires"
:
{
"base64-js"
:
"^1.0.2"
,
"ieee754"
:
"^1.1.4"
,
"isarray"
:
"^1.0.0"
}
},
"bytes"
:
{
"version"
:
"3.0.0"
,
"resolved"
:
"https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz"
,
...
...
@@ -163,6 +241,11 @@
"resolved"
:
"https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz"
,
"integrity"
:
"sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk="
},
"caseless"
:
{
"version"
:
"0.12.0"
,
"resolved"
:
"https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz"
,
"integrity"
:
"sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
},
"center-align"
:
{
"version"
:
"0.1.3"
,
"resolved"
:
"https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz"
,
...
...
@@ -222,6 +305,14 @@
"resolved"
:
"https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz"
,
"integrity"
:
"sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
},
"combined-stream"
:
{
"version"
:
"1.0.8"
,
"resolved"
:
"https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz"
,
"integrity"
:
"sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="
,
"requires"
:
{
"delayed-stream"
:
"~1.0.0"
}
},
"commander"
:
{
"version"
:
"2.8.1"
,
"resolved"
:
"https://registry.npmjs.org/commander/-/commander-2.8.1.tgz"
,
...
...
@@ -290,6 +381,14 @@
"resolved"
:
"https://registry.npmjs.org/crypto-js/-/crypto-js-4.0.0.tgz"
,
"integrity"
:
"sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg=="
},
"dashdash"
:
{
"version"
:
"1.14.1"
,
"resolved"
:
"https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz"
,
"integrity"
:
"sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA="
,
"requires"
:
{
"assert-plus"
:
"^1.0.0"
}
},
"debug"
:
{
"version"
:
"2.6.9"
,
"resolved"
:
"https://registry.npmjs.org/debug/-/debug-2.6.9.tgz"
,
...
...
@@ -303,6 +402,11 @@
"resolved"
:
"https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz"
,
"integrity"
:
"sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
},
"delayed-stream"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz"
,
"integrity"
:
"sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
},
"depd"
:
{
"version"
:
"1.1.2"
,
"resolved"
:
"https://registry.npmjs.org/depd/-/depd-1.1.2.tgz"
,
...
...
@@ -318,6 +422,15 @@
"resolved"
:
"https://registry.npmjs.org/doctypes/-/doctypes-1.1.0.tgz"
,
"integrity"
:
"sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk="
},
"ecc-jsbn"
:
{
"version"
:
"0.1.2"
,
"resolved"
:
"https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz"
,
"integrity"
:
"sha1-OoOpBOVDUyh4dMVkt1SThoSamMk="
,
"requires"
:
{
"jsbn"
:
"~0.1.0"
,
"safer-buffer"
:
"^2.1.0"
}
},
"ee-first"
:
{
"version"
:
"1.1.1"
,
"resolved"
:
"https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz"
,
...
...
@@ -356,6 +469,11 @@
"resolved"
:
"https://registry.npmjs.org/etag/-/etag-1.8.1.tgz"
,
"integrity"
:
"sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
},
"events"
:
{
"version"
:
"1.1.1"
,
"resolved"
:
"https://registry.npmjs.org/events/-/events-1.1.1.tgz"
,
"integrity"
:
"sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ="
},
"express"
:
{
"version"
:
"4.16.4"
,
"resolved"
:
"https://registry.npmjs.org/express/-/express-4.16.4.tgz"
,
...
...
@@ -427,6 +545,26 @@
}
}
},
"extend"
:
{
"version"
:
"3.0.2"
,
"resolved"
:
"https://registry.npmjs.org/extend/-/extend-3.0.2.tgz"
,
"integrity"
:
"sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
},
"extsprintf"
:
{
"version"
:
"1.3.0"
,
"resolved"
:
"https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz"
,
"integrity"
:
"sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
},
"fast-deep-equal"
:
{
"version"
:
"3.1.1"
,
"resolved"
:
"https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz"
,
"integrity"
:
"sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA=="
},
"fast-json-stable-stringify"
:
{
"version"
:
"2.1.0"
,
"resolved"
:
"https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz"
,
"integrity"
:
"sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
},
"filelist"
:
{
"version"
:
"1.0.1"
,
"resolved"
:
"https://registry.npmjs.org/filelist/-/filelist-1.0.1.tgz"
,
...
...
@@ -449,6 +587,21 @@
"unpipe"
:
"~1.0.0"
}
},
"forever-agent"
:
{
"version"
:
"0.6.1"
,
"resolved"
:
"https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz"
,
"integrity"
:
"sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
},
"form-data"
:
{
"version"
:
"2.3.3"
,
"resolved"
:
"https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz"
,
"integrity"
:
"sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ=="
,
"requires"
:
{
"asynckit"
:
"^0.4.0"
,
"combined-stream"
:
"^1.0.6"
,
"mime-types"
:
"^2.1.12"
}
},
"forwarded"
:
{
"version"
:
"0.1.2"
,
"resolved"
:
"https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz"
,
...
...
@@ -464,11 +617,33 @@
"resolved"
:
"https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"
,
"integrity"
:
"sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
"getpass"
:
{
"version"
:
"0.1.7"
,
"resolved"
:
"https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz"
,
"integrity"
:
"sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo="
,
"requires"
:
{
"assert-plus"
:
"^1.0.0"
}
},
"graceful-readlink"
:
{
"version"
:
"1.0.1"
,
"resolved"
:
"https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz"
,
"integrity"
:
"sha1-TK+tdrxi8C+gObL5Tpo906ORpyU="
},
"har-schema"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz"
,
"integrity"
:
"sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
},
"har-validator"
:
{
"version"
:
"5.1.3"
,
"resolved"
:
"https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz"
,
"integrity"
:
"sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g=="
,
"requires"
:
{
"ajv"
:
"^6.5.5"
,
"har-schema"
:
"^2.0.0"
}
},
"has"
:
{
"version"
:
"1.0.3"
,
"resolved"
:
"https://registry.npmjs.org/has/-/has-1.0.3.tgz"
,
...
...
@@ -493,6 +668,16 @@
"statuses"
:
">= 1.4.0 < 2"
}
},
"http-signature"
:
{
"version"
:
"1.2.0"
,
"resolved"
:
"https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz"
,
"integrity"
:
"sha1-muzZJRFHcvPZW2WmCruPfBj7rOE="
,
"requires"
:
{
"assert-plus"
:
"^1.0.0"
,
"jsprim"
:
"^1.2.2"
,
"sshpk"
:
"^1.7.0"
}
},
"iconv-lite"
:
{
"version"
:
"0.4.23"
,
"resolved"
:
"https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz"
,
...
...
@@ -501,6 +686,11 @@
"safer-buffer"
:
">= 2.1.2 < 3"
}
},
"ieee754"
:
{
"version"
:
"1.1.13"
,
"resolved"
:
"https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz"
,
"integrity"
:
"sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg=="
},
"inherits"
:
{
"version"
:
"2.0.3"
,
"resolved"
:
"https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz"
,
...
...
@@ -545,11 +735,21 @@
"has"
:
"^1.0.3"
}
},
"is-typedarray"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz"
,
"integrity"
:
"sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
},
"isarray"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz"
,
"integrity"
:
"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"isstream"
:
{
"version"
:
"0.1.2"
,
"resolved"
:
"https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz"
,
"integrity"
:
"sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
},
"jake"
:
{
"version"
:
"10.6.1"
,
"resolved"
:
"https://registry.npmjs.org/jake/-/jake-10.6.1.tgz"
,
...
...
@@ -561,11 +761,47 @@
"minimatch"
:
"^3.0.4"
}
},
"jmespath"
:
{
"version"
:
"0.15.0"
,
"resolved"
:
"https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz"
,
"integrity"
:
"sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc="
},
"js-stringify"
:
{
"version"
:
"1.0.2"
,
"resolved"
:
"https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz"
,
"integrity"
:
"sha1-Fzb939lyTyijaCrcYjCufk6Weds="
},
"jsbn"
:
{
"version"
:
"0.1.1"
,
"resolved"
:
"https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz"
,
"integrity"
:
"sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
},
"json-schema"
:
{
"version"
:
"0.2.3"
,
"resolved"
:
"https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz"
,
"integrity"
:
"sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
},
"json-schema-traverse"
:
{
"version"
:
"0.4.1"
,
"resolved"
:
"https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz"
,
"integrity"
:
"sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
},
"json-stringify-safe"
:
{
"version"
:
"5.0.1"
,
"resolved"
:
"https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz"
,
"integrity"
:
"sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
},
"jsprim"
:
{
"version"
:
"1.4.1"
,
"resolved"
:
"https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz"
,
"integrity"
:
"sha1-MT5mvB5cwG5Di8G3SZwuXFastqI="
,
"requires"
:
{
"assert-plus"
:
"1.0.0"
,
"extsprintf"
:
"1.3.0"
,
"json-schema"
:
"0.2.3"
,
"verror"
:
"1.10.0"
}
},
"jstransformer"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/jstransformer/-/jstransformer-1.0.0.tgz"
,
...
...
@@ -639,6 +875,11 @@
"brace-expansion"
:
"^1.1.7"
}
},
"moment"
:
{
"version"
:
"2.26.0"
,
"resolved"
:
"https://registry.npmjs.org/moment/-/moment-2.26.0.tgz"
,
"integrity"
:
"sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw=="
},
"morgan"
:
{
"version"
:
"1.9.1"
,
"resolved"
:
"https://registry.npmjs.org/morgan/-/morgan-1.9.1.tgz"
,
...
...
@@ -672,6 +913,11 @@
"resolved"
:
"https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz"
,
"integrity"
:
"sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
},
"oauth-sign"
:
{
"version"
:
"0.9.0"
,
"resolved"
:
"https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz"
,
"integrity"
:
"sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
},
"object-assign"
:
{
"version"
:
"4.1.1"
,
"resolved"
:
"https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz"
,
...
...
@@ -724,6 +970,11 @@
"resolved"
:
"https://registry.npmjs.org/pause/-/pause-0.0.1.tgz"
,
"integrity"
:
"sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10="
},
"performance-now"
:
{
"version"
:
"2.1.0"
,
"resolved"
:
"https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz"
,
"integrity"
:
"sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
},
"process-nextick-args"
:
{
"version"
:
"2.0.1"
,
"resolved"
:
"https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz"
,
...
...
@@ -746,6 +997,11 @@
"ipaddr.js"
:
"1.9.1"
}
},
"psl"
:
{
"version"
:
"1.8.0"
,
"resolved"
:
"https://registry.npmjs.org/psl/-/psl-1.8.0.tgz"
,
"integrity"
:
"sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ=="
},
"pug"
:
{
"version"
:
"2.0.0-beta11"
,
"resolved"
:
"https://registry.npmjs.org/pug/-/pug-2.0.0-beta11.tgz"
,
...
...
@@ -860,11 +1116,21 @@
"resolved"
:
"https://registry.npmjs.org/pug-walk/-/pug-walk-1.1.8.tgz"
,
"integrity"
:
"sha512-GMu3M5nUL3fju4/egXwZO0XLi6fW/K3T3VTgFQ14GxNi8btlxgT5qZL//JwZFm/2Fa64J/PNS8AZeys3wiMkVA=="
},
"punycode"
:
{
"version"
:
"1.3.2"
,
"resolved"
:
"https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"
,
"integrity"
:
"sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0="
},
"qs"
:
{
"version"
:
"6.5.2"
,
"resolved"
:
"https://registry.npmjs.org/qs/-/qs-6.5.2.tgz"
,
"integrity"
:
"sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
},
"querystring"
:
{
"version"
:
"0.2.0"
,
"resolved"
:
"https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz"
,
"integrity"
:
"sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA="
},
"random-bytes"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz"
,
...
...
@@ -910,6 +1176,33 @@
"resolved"
:
"https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz"
,
"integrity"
:
"sha1-jcrkcOHIirwtYA//Sndihtp15jc="
},
"request"
:
{
"version"
:
"2.88.2"
,
"resolved"
:
"https://registry.npmjs.org/request/-/request-2.88.2.tgz"
,
"integrity"
:
"sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw=="
,
"requires"
:
{
"aws-sign2"
:
"~0.7.0"
,
"aws4"
:
"^1.8.0"
,
"caseless"
:
"~0.12.0"
,
"combined-stream"
:
"~1.0.6"
,
"extend"
:
"~3.0.2"
,
"forever-agent"
:
"~0.6.1"
,
"form-data"
:
"~2.3.2"
,
"har-validator"
:
"~5.1.3"
,
"http-signature"
:
"~1.2.0"
,
"is-typedarray"
:
"~1.0.0"
,
"isstream"
:
"~0.1.2"
,
"json-stringify-safe"
:
"~5.0.1"
,
"mime-types"
:
"~2.1.19"
,
"oauth-sign"
:
"~0.9.0"
,
"performance-now"
:
"^2.1.0"
,
"qs"
:
"~6.5.2"
,
"safe-buffer"
:
"^5.1.2"
,
"tough-cookie"
:
"~2.5.0"
,
"tunnel-agent"
:
"^0.6.0"
,
"uuid"
:
"^3.3.2"
}
},
"resolve"
:
{
"version"
:
"1.17.0"
,
"resolved"
:
"https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz"
,
...
...
@@ -936,6 +1229,11 @@
"resolved"
:
"https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz"
,
"integrity"
:
"sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"sax"
:
{
"version"
:
"1.2.1"
,
"resolved"
:
"https://registry.npmjs.org/sax/-/sax-1.2.1.tgz"
,
"integrity"
:
"sha1-e45lYZCyKOgaZq6nSEgNgozS03o="
},
"send"
:
{
"version"
:
"0.16.2"
,
"resolved"
:
"https://registry.npmjs.org/send/-/send-0.16.2.tgz"
,
...
...
@@ -985,6 +1283,22 @@
"resolved"
:
"https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz"
,
"integrity"
:
"sha1-R1OT/56RR5rqYtyvDKPRSYOn+0A="
},
"sshpk"
:
{
"version"
:
"1.16.1"
,
"resolved"
:
"https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz"
,
"integrity"
:
"sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg=="
,
"requires"
:
{
"asn1"
:
"~0.2.3"
,
"assert-plus"
:
"^1.0.0"
,
"bcrypt-pbkdf"
:
"^1.0.0"
,
"dashdash"
:
"^1.12.0"
,
"ecc-jsbn"
:
"~0.1.1"
,
"getpass"
:
"^0.1.1"
,
"jsbn"
:
"~0.1.0"
,
"safer-buffer"
:
"^2.0.2"
,
"tweetnacl"
:
"~0.14.0"
}
},
"statuses"
:
{
"version"
:
"1.4.0"
,
"resolved"
:
"https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz"
,
...
...
@@ -1016,6 +1330,35 @@
"resolved"
:
"https://registry.npmjs.org/token-stream/-/token-stream-0.0.1.tgz"
,
"integrity"
:
"sha1-zu78cXp2xDFvEm0LnbqlXX598Bo="
},
"tough-cookie"
:
{
"version"
:
"2.5.0"
,
"resolved"
:
"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz"
,
"integrity"
:
"sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g=="
,
"requires"
:
{
"psl"
:
"^1.1.28"
,
"punycode"
:
"^2.1.1"
},
"dependencies"
:
{
"punycode"
:
{
"version"
:
"2.1.1"
,
"resolved"
:
"https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz"
,
"integrity"
:
"sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
}
}
},
"tunnel-agent"
:
{
"version"
:
"0.6.0"
,
"resolved"
:
"https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz"
,
"integrity"
:
"sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0="
,
"requires"
:
{
"safe-buffer"
:
"^5.0.1"
}
},
"tweetnacl"
:
{
"version"
:
"0.14.5"
,
"resolved"
:
"https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz"
,
"integrity"
:
"sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
},
"type-is"
:
{
"version"
:
"1.6.18"
,
"resolved"
:
"https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz"
,
...
...
@@ -1061,6 +1404,30 @@
"resolved"
:
"https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz"
,
"integrity"
:
"sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
},
"uri-js"
:
{
"version"
:
"4.2.2"
,
"resolved"
:
"https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz"
,
"integrity"
:
"sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ=="
,
"requires"
:
{
"punycode"
:
"^2.1.0"
},
"dependencies"
:
{
"punycode"
:
{
"version"
:
"2.1.1"
,
"resolved"
:
"https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz"
,
"integrity"
:
"sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
}
}
},
"url"
:
{
"version"
:
"0.10.3"
,
"resolved"
:
"https://registry.npmjs.org/url/-/url-0.10.3.tgz"
,
"integrity"
:
"sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ="
,
"requires"
:
{
"punycode"
:
"1.3.2"
,
"querystring"
:
"0.2.0"
}
},
"util-deprecate"
:
{
"version"
:
"1.0.2"
,
"resolved"
:
"https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz"
,
...
...
@@ -1071,11 +1438,26 @@
"resolved"
:
"https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz"
,
"integrity"
:
"sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
},
"uuid"
:
{
"version"
:
"3.3.2"
,
"resolved"
:
"https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz"
,
"integrity"
:
"sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
},
"vary"
:
{
"version"
:
"1.1.2"
,
"resolved"
:
"https://registry.npmjs.org/vary/-/vary-1.1.2.tgz"
,
"integrity"
:
"sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
},
"verror"
:
{
"version"
:
"1.10.0"
,
"resolved"
:
"https://registry.npmjs.org/verror/-/verror-1.10.0.tgz"
,
"integrity"
:
"sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA="
,
"requires"
:
{
"assert-plus"
:
"^1.0.0"
,
"core-util-is"
:
"1.0.2"
,
"extsprintf"
:
"^1.2.0"
}
},
"void-elements"
:
{
"version"
:
"2.0.1"
,
"resolved"
:
"https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz"
,
...
...
@@ -1100,6 +1482,20 @@
"resolved"
:
"https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
,
"integrity"
:
"sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8="
},
"xml2js"
:
{
"version"
:
"0.4.19"
,
"resolved"
:
"https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz"
,
"integrity"
:
"sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q=="
,
"requires"
:
{
"sax"
:
">=0.6.0"
,
"xmlbuilder"
:
"~9.0.1"
}
},
"xmlbuilder"
:
{
"version"
:
"9.0.7"
,
"resolved"
:
"https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz"
,
"integrity"
:
"sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0="
},
"yargs"
:
{
"version"
:
"3.10.0"
,
"resolved"
:
"https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz"
,
...
...
backend/package.json
View file @
c92dba1
...
...
@@ -6,6 +6,7 @@
"start"
:
"node ./bin/www"
},
"dependencies"
:
{
"aws-sdk"
:
"^2.683.0"
,
"cookie-parser"
:
"~1.4.4"
,
"crypto-js"
:
"^4.0.0"
,
"debug"
:
"~2.6.9"
,
...
...
@@ -13,9 +14,11 @@
"express"
:
"~4.16.1"
,
"express-session"
:
"^1.17.1"
,
"http-errors"
:
"~1.6.3"
,
"moment"
:
"^2.26.0"
,
"morgan"
:
"~1.9.1"
,
"mysql"
:
"^2.18.1"
,
"passport"
:
"^0.4.1"
,
"pug"
:
"2.0.0-beta11"
"pug"
:
"2.0.0-beta11"
,
"request"
:
"^2.88.2"
}
}
...
...
backend/routes/folders.js
0 → 100644
View file @
c92dba1
const
express
=
require
(
'express'
);
const
router
=
express
.
Router
();
const
AWS
=
require
(
"aws-sdk"
);
const
moment
=
require
(
"moment"
);
const
BUCKET_NAME
=
"hong-s3-cloud"
;
let
curPath
=
""
;
let
user_id
=
""
;
const
s3
=
new
AWS
.
S3
({
accessKeyId
:
process
.
env
.
AWS_ACCESS_KEY_ID
,
secretAccessKey
:
process
.
env
.
AWS_SECRET_ACCESS_KEY
,
region
:
"ap-northeast-2"
});
router
.
get
(
'/show'
,
function
(
req
,
res
,
next
)
{
console
.
log
(
req
.
query
);
user_id
=
req
.
query
.
id
;
curPath
=
req
.
query
.
cur
;
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
})
}
else
{
res
.
send
({
error
:
"Does not exist"
});
}
});
});
router
.
post
(
'/makefolder'
,
function
(
req
,
res
,
next
)
{
user_id
=
req
.
body
.
user_id
;
let
cur
=
req
.
body
.
cur
;
curPath
=
user_id
+
cur
;
let
folder_name
=
req
.
body
.
folder_name
;
let
date
=
moment
().
format
();
let
params
=
{
Bucket
:
BUCKET_NAME
,
Key
:
curPath
+
folder_name
+
'/'
,
Body
:
""
,
ACL
:
"public-read-write"
};
let
checksql
=
'SELECT * FROM folders WHERE location = ? AND folder_name = ?;'
;
console
.
log
(
req
.
body
)
connection
.
query
(
checksql
,
[
cur
,
folder_name
],
function
(
err
,
rows
,
fields
)
{
if
(
rows
.
length
==
0
)
{
s3
.
putObject
(
params
,
function
(
err
,
data
)
{
if
(
err
)
{
console
.
log
(
's3 error'
);
throw
err
;
}
else
{
console
.
log
(
data
);
}
});
let
sql
=
'INSERT INTO folders (folder_name,location,user_id,created) values (?,?,?,?);'
;
let
values
=
[
folder_name
,
cur
,
user_id
,
date
];
connection
.
query
(
sql
,
values
,
function
(
err
,
result
,
field
)
{
if
(
err
)
{
console
.
log
(
'insert error'
);
throw
err
;
}
else
{
folders
=
{}
let
checkfolder
=
'SELECT * FROM folders WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
checkfolder
,
[
cur
,
user_id
],
function
(
err
,
rows
,
fields
)
{
if
(
rows
.
length
!=
0
)
{
res
.
status
(
200
).
send
({
folders
:
rows
,
cur
:
curPath
})
}
else
{
res
.
send
({
error
:
"Does not exist"
});
}
});
}
});
}
else
{
res
.
status
(
404
).
send
({
error
:
"same name error"
});
}
});
});
router
.
post
(
'/delfolder'
,
function
(
req
,
res
,
next
)
{
user_id
=
req
.
body
.
user_id
;
curPath
=
user_id
+
req
.
body
.
cur
;
let
folder_name
=
req
.
body
.
folder_name
;
let
params
=
{
Bucket
:
BUCKET_NAME
+
curPath
,
Key
:
folder_name
+
'/'
};
let
checksql
=
'SELECT * FROM folders WHERE location = ? AND folder_name = ?;'
;
let
values
=
[
curPath
,
folder_name
];
connection
.
query
(
checksql
,
values
,
function
(
err
,
rows
,
fields
)
{
if
(
rows
.
length
!=
0
)
{
s3
.
deleteObject
(
params
,
function
(
err
,
data
)
{
if
(
err
)
{
//throw err;
}
else
{
let
sql
=
'DELETE FROM folders WHERE location = ? AND folder_name = ?;'
;
connection
.
query
(
sql
,
values
,
function
(
err
,
result
,
field
)
{
if
(
err
)
{
//throw err;
}
else
{
folders
=
{}
let
checkfolder
=
'SELECT * FROM folders WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
checkfolder
,
[
cur
,
user_id
],
function
(
err
,
rows
,
fields
)
{
if
(
rows
.
length
!=
0
)
{
res
.
status
(
200
).
send
({
folders
:
rows
,
cur
:
curPath
})
}
else
{
res
.
send
({
error
:
"Does not exist"
});
}
});
}
});
}
});
}
else
{
res
.
send
({
error
:
"Does not exist"
});
}
});
});
router
.
post
(
'/move'
,
function
(
req
,
res
,
next
)
{
user_id
=
req
.
body
.
user_id
;
curPath
=
user_id
+
req
.
body
.
cur
;
let
name
=
req
.
body
.
mfile
;
let
newPath
=
req
.
body
.
newPath
;
let
checkfolder
=
'SELECT * FROM folders WHERE location = ? AND folder_name = ?;'
;
if
(
req
.
body
.
isfolder
)
{
connection
.
query
(
checkfolder
,
[
curPath
,
name
],
function
(
err1
,
rows
,
fields
)
{
if
(
rows
.
length
!=
0
)
{
let
copy_params
=
{
Bucket
:
BUCKET_NAME
+
curPath
,
CopySource
:
BUCKET_NAME
+
curPath
+
file
+
'/'
,
Key
:
newPath
+
file
+
'/'
};
let
del_params
=
{
Bucket
:
BUCKET_NAME
+
curPath
,
Key
:
file
+
'/'
};
s3
.
copyObject
(
copy_params
,
function
(
err
,
data
)
{
console
.
log
(
err
,
data
);
});
s3
.
deleteObject
(
del_params
,
function
(
err
,
data
)
{
console
.
log
(
err
,
data
);
});
let
values
=
[
newPath
,
curPath
,
name
];
let
updatesql
=
'UPDATE folders SET location = ? WHERE location = ? AND folder_name = ?;'
;
connection
.
query
(
updatesql
,
values
,
function
(
err3
,
result
,
field
)
{
if
(
err3
)
{
throw
err
;
}
else
{
folders
=
{}
connection
.
query
(
checkfolder
,
[
cur
,
user_id
],
function
(
err
,
rows
,
fields
)
{
if
(
rows
.
length
!=
0
)
{
res
.
status
(
200
).
send
({
folders
:
rows
,
cur
:
curPath
})
}
else
{
res
.
send
({
error
:
"Does not exist"
});
}
});
}
});
}
else
{
res
.
send
({
error
:
"Does not exist"
});
}
});
}
else
{
let
checkfile
=
'SELECT * FROM files WHERE location = ? AND file_name = ?'
;
connection
.
query
(
checkfile
,
[
curPath
,
name
],
function
(
err1
,
rows
,
fields
)
{
if
(
rows
.
length
!=
0
)
{
let
copy_params
=
{
Bucket
:
BUCKET_NAME
+
curPath
,
CopySource
:
BUCKET_NAME
+
curPath
+
file
,
Key
:
newPath
+
file
};
let
del_params
=
{
Bucket
:
BUCKET_NAME
+
curPath
,
Key
:
file
};
s3
.
copyObject
(
copy_params
,
function
(
err
,
data
)
{
console
.
log
(
err
,
data
);
});
s3
.
deleteObject
(
del_params
,
function
(
err
,
data
)
{
console
.
log
(
err
,
data
);
});
let
values
=
[
newPath
,
curPath
,
name
];
let
updatesql
=
'UPDATE files SET location = ? WHERE location = ? AND file_name = ?;'
;
connection
.
query
(
updatesql
,
values
,
function
(
err3
,
result
,
field
)
{
if
(
err3
)
{
throw
err
;
}
else
{
folders
=
{}
connection
.
query
(
checkfolder
,
[
cur
,
user_id
],
function
(
err
,
rows
,
fields
)
{
if
(
rows
.
length
!=
0
)
{
res
.
status
(
200
).
send
({
folders
:
rows
,
cur
:
curPath
})
}
else
{
res
.
send
({
error
:
"Does not exist"
});
}
});
}
});
}
else
{
res
.
send
({
error
:
"Does not exist"
});
}
});
}
});
router
.
post
(
'/search/:target'
,
function
(
req
,
res
,
next
)
{
user_id
=
req
.
params
.
id
;
let
cur
=
req
.
params
.
cur
;
folders
=
{}
let
checkfolder
=
'SELECT * FROM folders WHERE location = ? AND user_id = ?;'
;
connection
.
query
(
checkfolder
,
[
cur
,
user_id
],
function
(
err
,
rows
,
fields
)
{
if
(
rows
.
length
!=
0
)
{
res
.
status
(
200
).
send
({
folders
:
folders
})
}
else
{
res
.
send
({
error
:
"Does not exist"
});
}
});
});
module
.
exports
=
router
;
\ No newline at end of file
front-end/src/api/index.js
View file @
c92dba1
...
...
@@ -7,15 +7,24 @@ const instance = axios.create({
function
registerUser
(
userData
)
{
// const url = 'http://localhost:3000/api/signup'
return
axios
.
post
(
'/api/RegistUser'
,
userData
);
}
}
function
loginUser
(
userData
)
{
function
loginUser
(
userData
)
{
// const url = 'http://localhost:3000/api/login'
return
axios
.
post
(
'/api/login'
,
userData
);
}
function
folder
(
curData
)
{
return
axios
.
get
(
'/api/folder/show'
,
{
params
:
{
id
:
curData
.
id
,
cur
:
curData
.
cur
}
});
}
function
dropbox
(
userData
)
{
return
axios
.
get
(
'/api/dropbox'
,
us
erData
);
function
makeFolder
(
folderData
)
{
return
axios
.
post
(
'/api/folder/makefolder'
,
fold
erData
);
}
export
{
registerUser
,
loginUser
,
dropbox
};
\ No newline at end of file
export
{
registerUser
,
loginUser
,
folder
,
makeFolder
};
\ No newline at end of file
...
...
front-end/src/components/FileList.vue
View file @
c92dba1
...
...
@@ -12,10 +12,8 @@
hide-details
></v-text-field>
</v-toolbar>
<v-list two-line subheader>
<v-subheader inset>Folders</v-subheader>
<v-list-item
v-for="item in this.$store.getters.folderL"
:key="item.title"
...
...
@@ -24,35 +22,28 @@
<v-list-item-avatar>
<v-icon>mdi-folder</v-icon>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title v-text="item"></v-list-item-title>
<v-list-item-title v-text="item
.folder_name
"></v-list-item-title>
</v-list-item-content>
<v-list-item-action>
<v-btn icon>
<v-icon color="grey lighten-1">mdi-information</v-icon>
</v-btn>
</v-list-item-action>
</v-list-item>
<v-divider inset></v-divider>
<v-subheader inset>Files</v-subheader>
<v-list-item
v-for="item in
items2
"
v-for="item in
this.$store.getters.fileL
"
:key="item.title"
@click=""
>
<v-list-item-avatar>
<v-icon> mdi-file</v-icon>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title v-text="item"></v-list-item-title>
</v-list-item-content>
<v-list-item-action>
<v-btn icon>
<v-icon color="grey lighten-1">mdi-information</v-icon>
...
...
@@ -81,7 +72,6 @@
>
{{ text }}
</v-chip>
<span
v-else-if="index === 2"
class="overline grey--text text--darken-3 mx-2"
...
...
@@ -90,44 +80,98 @@
</span>
</template>
</v-file-input>
<v-btn
bottom
color="blue"
dark
fab
fixed
right
@click="dialog = !dialog"
>
<v-icon>mdi-plus</v-icon>
</v-btn>
<v-dialog
v-model="dialog"
width="800px"
>
<v-card>
<v-card-title class="grey darken-2">
Create Folder
</v-card-title>
<v-container>
<div>
<v-icon>mdi-folder</v-icon>
<v-text-field placeholder="name" id="foldername" type="text" v-model="foldername"></v-text-field>
</div>
</v-container>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
text
color="primary"
@click="dialog = false"
>Cancel</v-btn>
<v-btn
text
@click="makeF"
>Create</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
<script>
import {
dropbox
} from '../api/index';
import {
folder, makeFolder
} from '../api/index';
export default {
data() {
return {
foldername:'',
folders: [],
files: [],
search:'',
dialog:false
}
},
async created(){
try {
const userData = {
user_id: this.$store.getters.userId,
cur: '/',
const curData = {
id : this.$store.state.id,
cur: this.$store.state.cur
}
const response = await folder(curData);
console.log(response);
this.$store.commit('setFolder', response.data.folders);
} catch (error) {
console.log("에러");
console.log(error.response.data);
}
},
methods: {
initFolderName(){
this.foldername = '';
},
async makeF(){
try {
const folderData = {
user_id : this.$store.state.id,
cur : this.$store.state.cur,
folder_name : this.foldername
};
const { data } = await dropbox(userData);
console.log(data);
this.$store.commit('setFolder', data.folders
);
this.$store.commit('setFile', data.file
s);
const response = await makeFolder(folderData);
console.log(response.data)
console.log("폴더 생성 완료"
);
this.$store.commit('setFolder', response.data.folder
s);
} catch (error) {
console.log("에러");
console.log(error.response.data);
} finally{
this.initFolderName();
this.dialog = false;
}
}
}
// data: () => ({
// items: [
// { icon: 'folder', iconClass: 'mdi-folder', title: 'Photos', subtitle: 'Jan 9, 2014' },
// { icon: 'folder', iconClass: 'mdi-folder', title: 'Recipes', subtitle: 'Jan 17, 2014' },
// { icon: 'folder', iconClass: 'mdi-folder', title: 'Work', subtitle: 'Jan 28, 2014' },
// ],
// items2: [
// { icon: 'assignment', iconClass: 'mdi-file', title: 'Vacation itinerary', subtitle: 'Jan 20, 2014' },
// { icon: 'call_to_action', iconClass: 'mdi-PdfBox', title: 'Kitchen remodel', subtitle: 'Jan 10, 2014' },
// ],
// }),
}
</script>
...
...
front-end/src/components/ToolView.vue
View file @
c92dba1
...
...
@@ -132,112 +132,6 @@
<router-view></router-view>
</v-container>
</v-content>
<template v-if="isUserLogin">
<v-btn
bottom
color="pink"
dark
fab
fixed
right
@click="dialog = !dialog"
>
<v-icon>mdi-plus</v-icon>
</v-btn>
</template>
<!-- <v-btn
bottom
color="pink"
dark
fab
fixed
right
@click="dialog = !dialog"
>
<v-icon>mdi-plus</v-icon>
</v-btn> -->
<v-dialog
v-model="dialog"
width="800px"
>
<v-card>
<v-card-title class="grey darken-2">
Create contact
</v-card-title>
<v-container>
<v-row class="mx-2">
<v-col
class="align-center justify-space-between"
cols="12"
>
<v-row
align="center"
class="mr-0"
>
<v-avatar
size="40px"
class="mx-3"
>
<img
src="//ssl.gstatic.com/s2/oz/images/sge/grey_silhouette.png"
alt=""
>
</v-avatar>
<v-text-field
placeholder="Name"
></v-text-field>
</v-row>
</v-col>
<v-col cols="6">
<v-text-field
prepend-icon="mdi-account-card-details-outline"
placeholder="Company"
></v-text-field>
</v-col>
<v-col cols="6">
<v-text-field
placeholder="Job title"
></v-text-field>
</v-col>
<v-col cols="12">
<v-text-field
prepend-icon="mdi-mail"
placeholder="Email"
></v-text-field>
</v-col>
<v-col cols="12">
<v-text-field
type="tel"
prepend-icon="mdi-phone"
placeholder="(000) 000 - 0000"
></v-text-field>
</v-col>
<v-col cols="12">
<v-text-field
prepend-icon="mdi-text"
placeholder="Notes"
></v-text-field>
</v-col>
</v-row>
</v-container>
<v-card-actions>
<v-btn
text
color="primary"
>More</v-btn>
<v-spacer></v-spacer>
<v-btn
text
color="primary"
@click="dialog = false"
>Cancel</v-btn>
<v-btn
text
@click="dialog = false"
>Save</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-app>
</template>
...
...
front-end/src/store/index.js
View file @
c92dba1
...
...
@@ -6,35 +6,42 @@ Vue.use(Vuex)
export
default
new
Vuex
.
Store
({
state
:
{
id
:
''
,
folders
:
[],
files
:
[],
folders
:
{},
files
:
{},
cur
:
'/'
,
},
mutations
:
{
setId
(
state
,
userid
)
{
setId
(
state
,
userid
)
{
state
.
id
=
userid
;
},
clearid
(
state
)
{
state
.
id
=
''
;
clearid
(
state
)
{
state
.
id
=
''
;
},
setFolder
(
state
,
folderlist
)
{
setFolder
(
state
,
folderlist
)
{
state
.
folders
=
folderlist
;
},
setFile
(
state
,
filelist
){
state
.
files
=
fileList
;
setFile
(
state
,
filelist
)
{
state
.
files
=
filelist
;
},
setCur
(
state
,
cur
)
{
state
.
cur
=
cur
;
}
},
getters
:
{
isLogin
(
state
)
{
isLogin
(
state
)
{
return
state
.
id
!==
''
;
},
userID
(
state
)
{
userID
(
state
)
{
return
state
.
id
;
},
folderL
(
state
)
{
folderL
(
state
)
{
return
state
.
folders
;
},
fileL
(
state
)
{
fileL
(
state
)
{
return
state
.
files
;
},
cur
(
state
)
{
return
state
.
cur
;
}
}
})
\ No newline at end of file
...
...
Please
register
or
login
to post a comment