leeseohyeon

.

{
<<<<<<< HEAD
"accessKeyId": "ASIAZQ5XTMMF3ELCTADR",
"secretAccessKey": "InEMPdQmNjV0SivIkw1UJwjGUDAFKrwvvPkAVVmx",
"sessionToken": "FwoGZXIvYXdzEJL//////////wEaDCaoEldiVQf3HLMLciLDAaOTxR/gqKjCnyFawPdFEqw4owZueDFAWp6jCQ1v/T0bYgXOU99OSdLvWt+EAN/l5avAn1N6ZN1H5fXIvqsKjCYtBwEn0jfI7rWdvaLfYgcU+dafml7WeUL2h2s4imrMf/MTVZl78W3I+xPe09r8UkcaJKVHl9Z5OSsgJOGFo3Htvv22H2HRuxYjTepgdqrPSa/xGbk0O4rQP3nJ7tYHMxhwg1GhYRz97Y6uPizaTybjLD2P7WhkBRiMz3903N4oE0HNqSin5ff2BTItxL9RngBajdIbW35ynftIZOeuL5HwWRUwG4GRmSan4xQKz0DYjQ6DEIxaRv6G",
=======
"accessKeyId": "ASIAXZL2SWFE2KIQ3YTL",
"secretAccessKey": "BqniXH7AqxjndKHjxBWKjRkBOgRmSN8J6mgldm7C",
"sessionToken": "FwoGZXIvYXdzEIL//////////wEaDC6uNIWZKpDL9FekbiLDAb7ckeHQwp1tV2wu236TIia7VBtYMFQrLzkEm6sU7GiamzWfzrTCsQOOJXYMKzElNXD7dRckn30aVaw8xfNDgimqWdtk9O3x8jgCOp4gXk4KIUgtIFpN46qdGNxy28gL43voIf4O6n3boJaUum9bmejzmNlR8U4d6NfqMzrtJENs47Nl4fAiK8bIGlsznhr7MC5AUeZbV0d9uK7bkx1rn5zRRpR9WbbwofVIlK+YSEEHfQIJyLeJKDlprBXfqSTynCqkAyj8ovT2BTItQ8+cOmQXWuzPMA/Rbru2naLM3Hd2H8jEW6CMfPXvNAS+leVNDXuCY5r5Ebo9",
>>>>>>> 0b0fb00b81690eb8f887c0988d582d628f157a61
"region": "us-east-1"
}
......
......@@ -16,7 +16,7 @@
var AWS = require('aws-sdk');
AWS.config.update({ region: 'ap-northeast-2' });
var BUCKET_NAME = 'khuloud';
var BUCKET_NAME = 'qkrrlqja-test';
var s3 = new AWS.S3();
var fs = require('fs');
......
......@@ -53,7 +53,7 @@ function uploadFile(fileData) {
}
function detailFile(fileData) {
return axios.get(`/api/file/${fileData.name}`, {
return axios.get(`/api/file/${fileData.fileName}`, {
params: {
id: fileData.id,
cur: fileData.cur,
......@@ -79,6 +79,25 @@ function downloadFile(fileData) {
},
});
}
function accessedList(curData) {
return axios.get(`api/quick`, {
params: {
//현재 접속한 사람의 id와 다운로드를 위해 선택한 파일의 이름을 파라미터로 넘긴다.
id: curData.id
},
});
}
function modifyFile(fileData){
return axios.post(`/api/file/modify/${fileName}`, {
params: {
user_id: fileData.id,
cur: fileData.cur,
name: fileData.rename,
content: fileData.content
},
});
}
export {
registerUser,
......@@ -91,4 +110,7 @@ export {
uploadFile,
deleteFile,
downloadFile,
accessedList,
detailFile,
modifyFile
};
......
<template lang="html">
<v-dialog
v-model="dialog"
max-width="290"
>
<v-card>
<v-card-title class="headline">Use Google's location service?</v-card-title>
<v-card-text>
Let Google help apps determine location. This means sending anonymous location data to Google, even when no apps are running.
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color="green darken-1"
text
@click="dialog = false"
>
Disagree
</v-btn>
<v-btn
color="green darken-1"
text
@click="dialog = false"
>
Agree
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
export default {
data(){
return{
dialog: false,
}
},
}
</script>
<style lang="css" scoped>
</style>
......@@ -75,7 +75,7 @@
</v-dialog>
<v-divider inset></v-divider>
<v-subheader inset>Files</v-subheader>
<v-list-item v-for="item in this.$store.getters.fileL" :key="item.title">
<v-list-item v-for="item in this.$store.getters.fileL" :key="item.title" @click.stop="dialog_file = true; file_detail(item)">
<v-list-item-avatar>
<v-icon> mdi-file</v-icon>
</v-list-item-avatar>
......@@ -83,13 +83,34 @@
<v-list-item-title v-text="item.file_name"></v-list-item-title>
</v-list-item-content>
<v-list-item-action>
</v-list-item-action>
<v-dialog
v-model="dialog_file"
max-width="290"
>
<v-card>
<v-card-title class="headline">
<v-text-field v-model="current_filename" v-text="current_filename"></v-text-field>
</v-card-title>
<v-card-text v-model="current_filedata" v-text="current_filedata"></v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color="green darken-1"
text
@click="dialog_file = false; modify_file(item);"
>
save
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-btn icon @click="download_file(item.file_name)">
<v-icon color="grey lighten-1">mdi-download</v-icon>
</v-btn>
<v-btn icon @click="delete_file(item.file_name)">
<v-icon color="grey lighten-1">mdi-delete</v-icon>
</v-btn>
</v-list-item-action>
</v-list-item>
</v-list>
<input
......@@ -170,9 +191,12 @@ import {
uploadFile,
deleteFile,
downloadFile,
detailFile,
modifyFile
} from '../api/index';
import Axios from 'axios';
export default {
data() {
return {
......@@ -189,6 +213,9 @@ export default {
x: 0,
y: 0,
dialog2: false,
dialog_file: false,
current_filename: null,
current_filedata: null,
detail: {
dataname: null,
date: null,
......@@ -397,6 +424,45 @@ export default {
console.log(error);
}
},
async file_detail(fileData){
try{
const currentData = {
id: fileData.user_id,
cur: fileData.location,
fileName: fileData.file_name
}
const detailData = await detailFile(currentData)
console.log(detailData)
this.current_filename = detailData.file_name;
this.current_filedata = detailFile.content;
}catch(error){
console.log('에러');
console.log(error);
}
},
async modify_file(fileData){
try{
const modifyData = {
user_id: fileData.user_id,
cur: fileData.location,
name: this.current_filename,
content: this.current_filedata
}
const result = await modifyFile(modifyData);
const after_data={
id: fileData.user_id,
cur: fileData.location,
fileName: this.current_filename
}
const detailData = await detailFile(after_data)
this.current_filename = detailData.file_name;
this.current_filedata = detailData.content;
}catch(error){
console.log('에러');
console.log(error);
}
}
},
show(folderN, e) {
e.preventDefault();
......
......@@ -24,12 +24,12 @@
</template>
<script>
import { accessed_list } from '../api/index';
import { accessedList } from '../api/index';
import Axios from 'axios';
export default {
data() {
return {
recent_list = []
recent_list : []
}
},
async created(){
......@@ -38,9 +38,9 @@
id : this.$store.state.id,
}
console.log(curData);
const list_reponse = await accessed_list(curData);
const list_reponse = await accessedList(curData);
this.$store.commit('setRecentList', list_reponse.data)
this.recent_list = this.$stroe.getters.recentL;
this.recent_list = this.$store.getters.recentL;
console.log(this.$store.getters.recentL);
} catch (error) {
console.log("에러");
......
<template lang="html">
<FileDetail></FileDetail>
</template>
<script>
import FileDetail from '@/components/FileDetail'
export default {
components:{
FileDetail
}
}
</script>
<style lang="css" scoped>
</style>
......@@ -21,7 +21,7 @@
</v-flex>
<v-flex><br><v-divider></v-divider><br></v-flex>
<v-container>
<accessList></accessList>
</v-container>
</v-flex>
<v-flex><br><v-divider></v-divider><br></v-flex>
......@@ -55,7 +55,7 @@
<script>
import Filecard from '@/components/accessList.vue'
import accessList from '@/components/accessList.vue'
export default {
data () {
return {
......
......@@ -27,6 +27,10 @@
<v-toolbar-title>빠른 액세스</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
<v-container>
<accessList></accessList>
</v-container>
<!--
<v-simple-table>
<template v-slot:default>
<thead>
......@@ -43,6 +47,7 @@
</tbody>
</template>
</v-simple-table>
-->
<v-divider></v-divider>
</v-flex>
</v-layout>
......@@ -52,6 +57,7 @@
<script>
import accessList from '@/components/accessList.vue'
import FileList from '@/components/FileList'
import Favlist from '@/components/Fav_list'
import Filecard from '@/components/FileCardlist.vue'
......@@ -59,7 +65,8 @@
components:{
FileList,
Favlist,
Filecard
Filecard,
accessList
},
data () {
return {
......