Hong

.

1 import axios from 'axios'; 1 import axios from 'axios';
2 2
3 const instance = axios.create({ 3 const instance = axios.create({
4 - baseURL: process.env.VUE_APP_API_URL, 4 + baseURL: process.env.VUE_APP_API_URL,
5 }); 5 });
6 6
7 function registerUser(userData) { 7 function registerUser(userData) {
8 - // const url = 'http://localhost:3000/api/signup' 8 + // const url = 'http://localhost:3000/api/signup'
9 - return axios.post('/api/RegistUser', userData); 9 + return axios.post('/api/RegistUser', userData);
10 } 10 }
11 11
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 } 15 }
16 16
17 function folder(curData) { 17 function folder(curData) {
18 - return axios.get('/api/folder/show', { 18 + return axios.get('/api/folder/show', {
19 - params: { 19 + params: {
20 - id: curData.id, 20 + id: curData.id,
21 - folder_id: curData.folder_id, 21 + folder_id: curData.folder_id,
22 - }, 22 + },
23 - }); 23 + });
24 } 24 }
25 25
26 function makeFolder(folderData) { 26 function makeFolder(folderData) {
27 - return axios.post('/api/folder/makefolder', folderData); 27 + return axios.post('/api/folder/makefolder', folderData);
28 } 28 }
29 29
30 function deleteFolder(folderData) { 30 function deleteFolder(folderData) {
31 - return axios.post('/api/folder/delfolder', folderData); 31 + return axios.post('/api/folder/delfolder', folderData);
32 } 32 }
33 33
34 function moveFolder(folderData) { 34 function moveFolder(folderData) {
35 - return axios.post('/api/folder/move', folderData); 35 + return axios.post('/api/folder/move', folderData);
36 } 36 }
37 37
38 function file(curData) { 38 function file(curData) {
39 - return axios.get('/api/file', { 39 + return axios.get('/api/file', {
40 - params: { 40 + params: {
41 - id: curData.id, 41 + id: curData.id,
42 - folder_id: curData.cur, 42 + folder_id: curData.cur,
43 - }, 43 + },
44 - }); 44 + });
45 } 45 }
46 46
47 function uploadFile(fileData) { 47 function uploadFile(fileData) {
48 - return axios.post('/api/file/upload', fileData, { 48 + return axios.post('/api/file/upload', fileData, {
49 - headers: { 49 + headers: {
50 - 'Content-Type': 'multipart/form-data', 50 + 'Content-Type': 'multipart/form-data',
51 - }, 51 + },
52 - }); 52 + });
53 } 53 }
54 54
55 function detailFile(fileData) { 55 function detailFile(fileData) {
56 - return axios.get(`/api/file/${fileData.fileName}`, { 56 + return axios.get(`/api/file/${fileData.fileName}`, {
57 - params: { 57 + params: {
58 - id: fileData.id, 58 + id: fileData.id,
59 - cur: fileData.cur, 59 + cur: fileData.cur,
60 - }, 60 + },
61 - }); 61 + });
62 } 62 }
63 63
64 function deleteFile(fileData) { 64 function deleteFile(fileData) {
65 - return axios.get(`/api/file/delete/${fileData.fileName}`, { 65 + return axios.get(`/api/file/delete/${fileData.fileName}`, {
66 - params: { 66 + params: {
67 - //현재 접속한 사람의 id와 삭제할 파일의 이름, 현재 폴더위치를 파라미터로 넘긴다. 67 + //현재 접속한 사람의 id와 삭제할 파일의 이름, 현재 폴더위치를 파라미터로 넘긴다.
68 - id: fileData.user_id, 68 + id: fileData.user_id,
69 - cur: fileData.cur, 69 + cur: fileData.cur,
70 - }, 70 + },
71 - }); 71 + });
72 } 72 }
73 +
73 function downloadFile(fileData) { 74 function downloadFile(fileData) {
74 - return axios.get(`api/file/download/${fileData.fileName}`, { 75 + return axios.get(`/api/file/download/${fileData.fileName}`, {
75 - params: { 76 + params: {
76 - //현재 접속한 사람의 id와 다운로드를 위해 선택한 파일의 이름을 파라미터로 넘긴다. 77 + //현재 접속한 사람의 id와 다운로드를 위해 선택한 파일의 이름을 파라미터로 넘긴다.
77 - id: fileData.id, 78 + id: fileData.id,
78 - cur: fileData.cur, 79 + cur: fileData.cur,
79 - }, 80 + },
80 - }); 81 + });
81 } 82 }
83 +
82 function accessedList(curData) { 84 function accessedList(curData) {
83 - return axios.get('api/quick', { 85 + return axios.get('/api/quick', {
84 - params: { 86 + params: {
85 - id: curData.id, 87 + id: curData.id,
86 - }, 88 + },
87 - }); 89 + });
88 } 90 }
91 +
89 function modifyFile(fileData) { 92 function modifyFile(fileData) {
90 - return axios.post(`/api/file/modify/${fileData.name}`, fileData); 93 + return axios.post(`/api/file/modify/${fileData.name}`, fileData);
91 } 94 }
95 +
92 function delFavorite(folderData) { 96 function delFavorite(folderData) {
93 - return axios.post('api/favorites/delfolder', folderData); 97 + return axios.post('/api/favorites/delfolder', folderData);
94 } 98 }
95 99
96 function addFavorite(folderData) { 100 function addFavorite(folderData) {
97 - return axios.post('api/favorites/addfolder', folderData); 101 + return axios.post('/api/favorites/addfolder', folderData);
98 } 102 }
99 103
100 function moveFile(fileData) { 104 function moveFile(fileData) {
101 - return axios.post('/api/folder/move', fileData); 105 + return axios.post('/api/folder/move', fileData);
102 } 106 }
103 107
104 function delFavoriteFile(fileData) { 108 function delFavoriteFile(fileData) {
105 - return axios.post('api/favorites/delfile', fileData); 109 + return axios.post('/api/favorites/delfile', fileData);
106 } 110 }
107 111
108 function addFavoriteFile(fileData) { 112 function addFavoriteFile(fileData) {
109 - return axios.post('api/favorites/addfile', fileData); 113 + return axios.post('/api/favorites/addfile', fileData);
110 } 114 }
111 115
112 function getFavoriteList(userId) { 116 function getFavoriteList(userId) {
113 - return axios.get('api/favorites/show', { 117 + return axios.get('/api/favorites/show', {
114 - params: { 118 + params: {
115 - id: userId, 119 + id: userId,
116 - }, 120 + },
117 - }); 121 + });
118 } 122 }
119 123
120 export { 124 export {
121 - registerUser, 125 + registerUser,
122 - loginUser, 126 + loginUser,
123 - folder, 127 + folder,
124 - makeFolder, 128 + makeFolder,
125 - deleteFolder, 129 + deleteFolder,
126 - moveFolder, 130 + moveFolder,
127 - file, 131 + file,
128 - uploadFile, 132 + uploadFile,
129 - deleteFile, 133 + deleteFile,
130 - downloadFile, 134 + downloadFile,
131 - delFavorite, 135 + delFavorite,
132 - addFavorite, 136 + addFavorite,
133 - moveFile, 137 + moveFile,
134 - delFavoriteFile, 138 + delFavoriteFile,
135 - addFavoriteFile, 139 + addFavoriteFile,
136 - accessedList, 140 + accessedList,
137 - detailFile, 141 + detailFile,
138 - modifyFile, 142 + modifyFile,
139 - getFavoriteList, 143 + getFavoriteList,
140 -}; 144 +};
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -14,9 +14,6 @@ ...@@ -14,9 +14,6 @@
14 <v-list two-line subheader> 14 <v-list two-line subheader>
15 <!-- <v-subheader inset>Folders</v-subheader> --> 15 <!-- <v-subheader inset>Folders</v-subheader> -->
16 <!-- Folder view --> 16 <!-- Folder view -->
17 - <v-list-item v-if="this.$store.state.cur !== '/'" @click="moveParent"
18 - >...</v-list-item
19 - >
20 <v-list-item 17 <v-list-item
21 v-for="item in this.$store.getters.folderL" 18 v-for="item in this.$store.getters.folderL"
22 :key="item.folder_id" 19 :key="item.folder_id"
......
...@@ -14,7 +14,10 @@ ...@@ -14,7 +14,10 @@
14 <v-list two-line subheader> 14 <v-list two-line subheader>
15 <!-- <v-subheader inset>Folders</v-subheader> --> 15 <!-- <v-subheader inset>Folders</v-subheader> -->
16 <!-- Folder view --> 16 <!-- Folder view -->
17 - <v-list-item @click="$router.go(-1)">...</v-list-item> 17 + <v-list-item
18 + @click=""
19 + @dblclick="$router.go(-1)"
20 + >...</v-list-item>
18 <v-list-item 21 <v-list-item
19 v-for="item in this.$store.getters.folderL" 22 v-for="item in this.$store.getters.folderL"
20 :key="item.folder_id" 23 :key="item.folder_id"
......