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
박기범
2020-06-10 23:19:31 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c759522373a53b9c6b9bb9c16fe47296bb0055d8
c7595223
1 parent
a2ca848c
add delete api
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
22 deletions
backend/routes/modules/awsconfig.json
front-end/src/api/index.js
front-end/src/components/folderc.vue
front-end/src/components/make_contact.vue
backend/routes/modules/awsconfig.json
View file @
c759522
{
"accessKeyId"
:
"
ASIAXZL2SWFEQ3A42BQP
"
,
"secretAccessKey"
:
"
7VxG6RfekqWejvtLfdgLtZbxpXcUg6NshtTueiUV
"
,
"sessionToken"
:
"
FwoGZXIvYXdzEMP//////////wEaDBXRmjIedzbi/hfWTCLDAY+AZ+EfzHvy0eV/zjF53n2JhNPJADGD+T32qA6dsBBNs4EyfXoejbu/9k1Evr2h042JwGLb7rZpnEFk46KoGGqo/mBRr+PLlKExbfnPLE6s3SRT0sdqgXkXS+7gQ/Y4aBB1+WLBySso2GxwftcUEJS/pC2YUdonzEpypIRUGD87aJaaMKIc5i9U7oh8uDht2FXWBEIWjhJAkBd+xuMyrhjq474NYCbQlQtG5annxEz5F5MQuKBKCk4G2yPlkGQ7Z0DmgyiNzIL3BTItePAyPGDb/Mvl+8aUiEgkysdTY0YUMhLaepwCzwlV9nuyfpVV2SH5gMoDmKoD
"
,
"region"
:
"
us-east-1
"
"accessKeyId"
:
""
,
"secretAccessKey"
:
""
,
"sessionToken"
:
""
,
"region"
:
""
}
...
...
front-end/src/api/index.js
View file @
c759522
...
...
@@ -109,17 +109,26 @@ function addFavoriteFile(fileData) {
return
axios
.
post
(
'api/favorites/addfile'
,
fileData
);
}
function
uploadContact
(
contactData
){
return
axios
.
post
(
'/api/contact/contact_upload'
,
contactData
,{
return
axios
.
post
(
'/api/contact/contact_upload'
,
contactData
.
file
,{
headers
:
{
'Content-Type'
:
'multipart/form-data'
,
},
params
:{
id
:
contactData
.
id
,
}
});
}
function
downloadContact
(
userID
){
return
axios
.
post
(
'/api/contact/contact_download'
,
userID
);
return
axios
.
post
(
'/api/contact/contact_download'
,
null
,
{
params
:{
id
:
userID
}}
);
}
function
printContact
(
userID
){
return
axios
.
post
(
'/api/contact/contact_list'
,
userID
);
console
.
log
(
String
(
userID
));
return
axios
.
post
(
'api/contact/contact_list'
,
{
id
:
userID
},
{
params
:{
id
:
userID
},});
}
function
deleteContact
(
userID
){
return
axios
.
post
(
'api/contact/contact_delete'
,
{
id
:
userID
},
{
params
:{
id
:
userID
}});
}
export
{
...
...
@@ -143,5 +152,6 @@ export {
modifyFile
,
uploadContact
,
downloadContact
,
printContact
printContact
,
deleteContact
};
...
...
front-end/src/components/folderc.vue
0 → 100644
View file @
c759522
This diff is collapsed. Click to expand it.
front-end/src/components/make_contact.vue
View file @
c759522
...
...
@@ -8,7 +8,6 @@
<th class="text-left">Name</th>
<th class="text-left">Phone</th>
<th class="text-left">Email</th>
<th class="text-left">Date</th>
</tr>
</thead>
<tbody>
...
...
@@ -16,7 +15,6 @@
<td>{{ item.name }}</td>
<td>{{ item.phone}}</td>
<td>{{ item.email }}</td>
<td>{{ item.added_date}}</td>
</tr>
</tbody>
</template>
...
...
@@ -32,12 +30,13 @@
</div>
<br />
<v-btn color="blue" @click="upload_contact">upload</v-btn>
<v-btn color="blud" @click = "download_contact">download</v-btn>
<v-btn color="green" @click = "download_contact">download</v-btn>
<v-btn color="gray" @click = "delete_contact">delete</v-btn>
</v-flex>
</template>
<script>
import { uploadContact, downloadContact, printContact } from '../api/index';
import { uploadContact, downloadContact, printContact
, deleteContact
} from '../api/index';
import Axios from 'axios';
export default {
data() {
...
...
@@ -51,10 +50,10 @@
const curData = {
id : this.$store.state.id,
}
console.log(curData);
const list_reponse = await printContact(curData);
this.$store.commit('setContactList', list_reponse);
const list_reponse = await printContact(curData.id);
this.$store.commit('setContactList', list_reponse.data.contact_list);
this.contact_list = this.$store.getters.contact;
console.log(list_reponse);
} catch (error) {
console.log("에러");
console.log(error);
...
...
@@ -74,21 +73,20 @@
try {
const formData = new FormData();
formData.append('file', this.contact_file);
formData.append('id', this.$store.state.id);
const currentData = {
id: this.$store.state.id
};
const fileData = {
id: this.$store.state.id,
file:
this.contact_file
file:
formData
}
console.log(fileData);
const response = await uploadContact(f
orm
Data);
const contact_response = await printContact(currentData);
const response = await uploadContact(f
ile
Data);
const contact_response = await printContact(currentData
.id
);
console.log(contact_response);
this.$store.commit('setContactList', contact_response);
this.$store.commit('setContactList', contact_response
.data.contact_list
);
console.log(this.$store.getters.contact);
this.contact_list =
contact_response
;
this.contact_list =
this.$store.getters.contact
;
} catch (error) {
console.log('에러');
console.log(error);
...
...
@@ -100,12 +98,29 @@
id: this.$store.state.id
};
console.log(curData);
const response = await downloadContact(curData);
const response = await downloadContact(curData
.id
);
console.log(response);
}catch(error){
console.log('에러');
console.log(error);
}
},
async delete_contact(){
try{
const curData = {
id: this.$store.state.id
};
const response_d = await deleteContact(curData.id);
const contact_response = await printContact(curData.id);
this.$store.commit('setContactList', contact_response.data.contact_list);
this.contact_list = this.$store.getters.contact;
}catch(error){
console.log('에러');
console.log(error);
}
}
}
...
...
Please
register
or
login
to post a comment