Hong
......@@ -12,6 +12,7 @@ function registerUser(userData) {
function loginUser(userData) {
// const url = 'http://localhost:3000/api/login'
return axios.post('/api/login', userData);
<<<<<<< HEAD
}
function folder(curData) {
......@@ -27,4 +28,17 @@ function makeFolder(folderData) {
return axios.post('/api/folder/makefolder', folderData);
}
export { registerUser, loginUser, folder, makeFolder };
\ No newline at end of file
export { registerUser, loginUser, folder, makeFolder };
=======
}
function dropbox(userData){
return axios.get(`/api/folder/show/${userData}`);
}
function makeFolder(folderData){
return axios.post('/api/folder/makefolder', folderData);
}
export { registerUser, loginUser, dropbox, makeFolder };
>>>>>>> eacf2da71fd7ae8340b48d4dac8ee121a816fd94
......
......@@ -79,7 +79,11 @@
+{{ files.length - 2 }} File(s)
</span>
</template>
<<<<<<< HEAD
</v-file-input>
=======
</v-file-input>
>>>>>>> eacf2da71fd7ae8340b48d4dac8ee121a816fd94
<v-btn
bottom
color="blue"
......@@ -102,7 +106,11 @@
<v-container>
<div>
<v-icon>mdi-folder</v-icon>
<<<<<<< HEAD
<v-text-field placeholder="name" id="foldername" type="text" v-model="foldername"></v-text-field>
=======
<v-text-field placeholder="name" id="foldername" type="text" v-model="foldername" ></v-text-field>
>>>>>>> eacf2da71fd7ae8340b48d4dac8ee121a816fd94
</div>
</v-container>
<v-card-actions>
......@@ -123,6 +131,7 @@
</template>
<script>
<<<<<<< HEAD
import { folder, makeFolder } from '../api/index';
export default {
data() {
......@@ -131,11 +140,25 @@ import { folder, makeFolder } from '../api/index';
folders: [],
files: [],
search:'',
id: '',
dialog:false
=======
import { dropbox, makeFolder } from '../api/index';
export default {
data() {
return {
foldername: '',
folders: [],
files: [],
search:'',
id: '',
dialog: false,
>>>>>>> eacf2da71fd7ae8340b48d4dac8ee121a816fd94
}
},
async created(){
try {
<<<<<<< HEAD
const curData = {
id : this.$store.state.id,
cur: this.$store.state.cur
......@@ -143,11 +166,21 @@ import { folder, makeFolder } from '../api/index';
const response = await folder(curData);
console.log(response);
this.$store.commit('setFolder', response.data.folders);
=======
const userData = this.$store.state.id;
console.log(this.id);
const response = await dropbox(userData);
console.log(response);
this.$store.commit('setFolder', response.data.folders);
this.$store.commit('setFile', response.data.files);
>>>>>>> eacf2da71fd7ae8340b48d4dac8ee121a816fd94
} catch (error) {
console.log("에러");
console.log(error.response.data);
}
},
<<<<<<< HEAD
methods: {
initFolderName(){
this.foldername = '';
......@@ -173,5 +206,30 @@ import { folder, makeFolder } from '../api/index';
}
}
=======
methods: {
initFolderName(){
this.foldername = '';
},
async makeF(){
try {
const folderData = {
user_id : this.$store.state.id,
cur : this.$store.state.id,
folder_name : this.foldername
};
const response = await makeFolder(folderData);
this.$store.commit('setFolder', response.data.folders);
console.log("폴더 생성 완료");
} catch (error) {
console.log("에러");
console.log(error.response.data);
} finally{
this.initFolderName();
this.dialog = false;
}
}
}
>>>>>>> eacf2da71fd7ae8340b48d4dac8ee121a816fd94
}
</script>
......
......@@ -4,11 +4,23 @@ import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
<<<<<<< HEAD
state: {
id: '',
folders: {},
files: {},
cur: '/',
=======
state: {
id: '',
folders: [],
files: [],
cur:'/',
},
mutations: {
setId(state, userid){
state.id = userid;
>>>>>>> eacf2da71fd7ae8340b48d4dac8ee121a816fd94
},
mutations: {
setId(state, userid) {
......@@ -27,6 +39,7 @@ export default new Vuex.Store({
state.cur = cur;
}
},
<<<<<<< HEAD
getters: {
isLogin(state) {
return state.id !== '';
......@@ -43,5 +56,26 @@ export default new Vuex.Store({
cur(state) {
return state.cur;
}
=======
setFolder(state, folderlist){
state.folders = folderlist;
},
setFile(state, filelist){
state.files = filelist;
},
},
getters: {
isLogin(state){
return state.id !== '';
},
userID(state){
return state.id;
},
folderL(state){
return state.folders;
},
fileL(state){
return state.files;
>>>>>>> eacf2da71fd7ae8340b48d4dac8ee121a816fd94
}
})
\ No newline at end of file
......