Hong
...@@ -12,6 +12,7 @@ function registerUser(userData) { ...@@ -12,6 +12,7 @@ function registerUser(userData) {
12 function loginUser(userData) { 12 function loginUser(userData) {
13 // const url = 'http://localhost:3000/api/login' 13 // const url = 'http://localhost:3000/api/login'
14 return axios.post('/api/login', userData); 14 return axios.post('/api/login', userData);
15 +<<<<<<< HEAD
15 } 16 }
16 17
17 function folder(curData) { 18 function folder(curData) {
...@@ -27,4 +28,17 @@ function makeFolder(folderData) { ...@@ -27,4 +28,17 @@ function makeFolder(folderData) {
27 return axios.post('/api/folder/makefolder', folderData); 28 return axios.post('/api/folder/makefolder', folderData);
28 } 29 }
29 30
30 -export { registerUser, loginUser, folder, makeFolder };
...\ No newline at end of file ...\ No newline at end of file
31 +export { registerUser, loginUser, folder, makeFolder };
32 +=======
33 + }
34 +
35 +function dropbox(userData){
36 + return axios.get(`/api/folder/show/${userData}`);
37 +}
38 +
39 +function makeFolder(folderData){
40 + return axios.post('/api/folder/makefolder', folderData);
41 +}
42 +
43 + export { registerUser, loginUser, dropbox, makeFolder };
44 +>>>>>>> eacf2da71fd7ae8340b48d4dac8ee121a816fd94
......
...@@ -79,7 +79,11 @@ ...@@ -79,7 +79,11 @@
79 +{{ files.length - 2 }} File(s) 79 +{{ files.length - 2 }} File(s)
80 </span> 80 </span>
81 </template> 81 </template>
82 +<<<<<<< HEAD
82 </v-file-input> 83 </v-file-input>
84 +=======
85 + </v-file-input>
86 +>>>>>>> eacf2da71fd7ae8340b48d4dac8ee121a816fd94
83 <v-btn 87 <v-btn
84 bottom 88 bottom
85 color="blue" 89 color="blue"
...@@ -102,7 +106,11 @@ ...@@ -102,7 +106,11 @@
102 <v-container> 106 <v-container>
103 <div> 107 <div>
104 <v-icon>mdi-folder</v-icon> 108 <v-icon>mdi-folder</v-icon>
109 +<<<<<<< HEAD
105 <v-text-field placeholder="name" id="foldername" type="text" v-model="foldername"></v-text-field> 110 <v-text-field placeholder="name" id="foldername" type="text" v-model="foldername"></v-text-field>
111 +=======
112 + <v-text-field placeholder="name" id="foldername" type="text" v-model="foldername" ></v-text-field>
113 +>>>>>>> eacf2da71fd7ae8340b48d4dac8ee121a816fd94
106 </div> 114 </div>
107 </v-container> 115 </v-container>
108 <v-card-actions> 116 <v-card-actions>
...@@ -123,6 +131,7 @@ ...@@ -123,6 +131,7 @@
123 </template> 131 </template>
124 132
125 <script> 133 <script>
134 +<<<<<<< HEAD
126 import { folder, makeFolder } from '../api/index'; 135 import { folder, makeFolder } from '../api/index';
127 export default { 136 export default {
128 data() { 137 data() {
...@@ -131,11 +140,25 @@ import { folder, makeFolder } from '../api/index'; ...@@ -131,11 +140,25 @@ import { folder, makeFolder } from '../api/index';
131 folders: [], 140 folders: [],
132 files: [], 141 files: [],
133 search:'', 142 search:'',
143 + id: '',
134 dialog:false 144 dialog:false
145 +=======
146 +import { dropbox, makeFolder } from '../api/index';
147 + export default {
148 + data() {
149 + return {
150 + foldername: '',
151 + folders: [],
152 + files: [],
153 + search:'',
154 + id: '',
155 + dialog: false,
156 +>>>>>>> eacf2da71fd7ae8340b48d4dac8ee121a816fd94
135 } 157 }
136 }, 158 },
137 async created(){ 159 async created(){
138 try { 160 try {
161 +<<<<<<< HEAD
139 const curData = { 162 const curData = {
140 id : this.$store.state.id, 163 id : this.$store.state.id,
141 cur: this.$store.state.cur 164 cur: this.$store.state.cur
...@@ -143,11 +166,21 @@ import { folder, makeFolder } from '../api/index'; ...@@ -143,11 +166,21 @@ import { folder, makeFolder } from '../api/index';
143 const response = await folder(curData); 166 const response = await folder(curData);
144 console.log(response); 167 console.log(response);
145 this.$store.commit('setFolder', response.data.folders); 168 this.$store.commit('setFolder', response.data.folders);
169 +=======
170 + const userData = this.$store.state.id;
171 + console.log(this.id);
172 +
173 + const response = await dropbox(userData);
174 + console.log(response);
175 + this.$store.commit('setFolder', response.data.folders);
176 + this.$store.commit('setFile', response.data.files);
177 +>>>>>>> eacf2da71fd7ae8340b48d4dac8ee121a816fd94
146 } catch (error) { 178 } catch (error) {
147 console.log("에러"); 179 console.log("에러");
148 console.log(error.response.data); 180 console.log(error.response.data);
149 } 181 }
150 }, 182 },
183 +<<<<<<< HEAD
151 methods: { 184 methods: {
152 initFolderName(){ 185 initFolderName(){
153 this.foldername = ''; 186 this.foldername = '';
...@@ -173,5 +206,30 @@ import { folder, makeFolder } from '../api/index'; ...@@ -173,5 +206,30 @@ import { folder, makeFolder } from '../api/index';
173 } 206 }
174 207
175 } 208 }
209 +=======
210 + methods: {
211 + initFolderName(){
212 + this.foldername = '';
213 + },
214 + async makeF(){
215 + try {
216 + const folderData = {
217 + user_id : this.$store.state.id,
218 + cur : this.$store.state.id,
219 + folder_name : this.foldername
220 + };
221 + const response = await makeFolder(folderData);
222 + this.$store.commit('setFolder', response.data.folders);
223 + console.log("폴더 생성 완료");
224 + } catch (error) {
225 + console.log("에러");
226 + console.log(error.response.data);
227 + } finally{
228 + this.initFolderName();
229 + this.dialog = false;
230 + }
231 + }
232 + }
233 +>>>>>>> eacf2da71fd7ae8340b48d4dac8ee121a816fd94
176 } 234 }
177 </script> 235 </script>
......
...@@ -4,11 +4,23 @@ import Vuex from 'vuex' ...@@ -4,11 +4,23 @@ import Vuex from 'vuex'
4 Vue.use(Vuex) 4 Vue.use(Vuex)
5 5
6 export default new Vuex.Store({ 6 export default new Vuex.Store({
7 +<<<<<<< HEAD
7 state: { 8 state: {
8 id: '', 9 id: '',
9 folders: {}, 10 folders: {},
10 files: {}, 11 files: {},
11 cur: '/', 12 cur: '/',
13 +=======
14 + state: {
15 + id: '',
16 + folders: [],
17 + files: [],
18 + cur:'/',
19 + },
20 + mutations: {
21 + setId(state, userid){
22 + state.id = userid;
23 +>>>>>>> eacf2da71fd7ae8340b48d4dac8ee121a816fd94
12 }, 24 },
13 mutations: { 25 mutations: {
14 setId(state, userid) { 26 setId(state, userid) {
...@@ -27,6 +39,7 @@ export default new Vuex.Store({ ...@@ -27,6 +39,7 @@ export default new Vuex.Store({
27 state.cur = cur; 39 state.cur = cur;
28 } 40 }
29 }, 41 },
42 +<<<<<<< HEAD
30 getters: { 43 getters: {
31 isLogin(state) { 44 isLogin(state) {
32 return state.id !== ''; 45 return state.id !== '';
...@@ -43,5 +56,26 @@ export default new Vuex.Store({ ...@@ -43,5 +56,26 @@ export default new Vuex.Store({
43 cur(state) { 56 cur(state) {
44 return state.cur; 57 return state.cur;
45 } 58 }
59 +=======
60 + setFolder(state, folderlist){
61 + state.folders = folderlist;
62 + },
63 + setFile(state, filelist){
64 + state.files = filelist;
65 + },
66 + },
67 + getters: {
68 + isLogin(state){
69 + return state.id !== '';
70 + },
71 + userID(state){
72 + return state.id;
73 + },
74 + folderL(state){
75 + return state.folders;
76 + },
77 + fileL(state){
78 + return state.files;
79 +>>>>>>> eacf2da71fd7ae8340b48d4dac8ee121a816fd94
46 } 80 }
47 }) 81 })
...\ No newline at end of file ...\ No newline at end of file
......