Skip to content

Commit

Permalink
优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
gzydong committed Jul 8, 2021
1 parent c9fcb4d commit faf75ad
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
30 changes: 16 additions & 14 deletions src/api/contacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ export const ServeGetContacts = data => {
return get('/api/v1/contacts/list', data)
}

// 好友申请服务接口
export const ServeCreateContact = data => {
return post('/api/v1/contacts/add', data)
}

// 解除好友关系服务接口
export const ServeDeleteContact = data => {
Expand All @@ -20,27 +16,33 @@ export const ServeEditContactRemark = data => {
return post('/api/v1/contacts/edit-remark', data)
}

// 查询好友申请未读数量服务接口
export const ServeFindFriendApplyNum = () => {
return get('/api/v1/contacts/apply-unread-num')
// 搜索联系人
export const ServeSearchContact = data => {
return get('/api/v1/contacts/search', data)
}


// 好友申请服务接口
export const ServeCreateContact = data => {
return post('/api/v1/contacts/apply/create', data)
}

// 查询好友申请服务接口
export const ServeGetContactApplyRecords = data => {
return get('/api/v1/contacts/apply-records', data)
return get('/api/v1/contacts/apply/records', data)
}

// 处理好友申请服务接口
export const ServeHandleFriendApply = data => {
return post('/api/v1/contacts/accept-invitation', data)
return post('/api/v1/contacts/apply/accept', data)
}

// 删除好友申请记录服务接口
export const ServeDeleteContactApply = data => {
return post('/api/v1/contacts/delete-apply', data)
return post('/api/v1/contacts/apply/delete', data)
}

// 搜索联系人
export const ServeSearchContact = data => {
return get('/api/v1/contacts/search', data)
}
// 查询好友申请未读数量服务接口
export const ServeFindFriendApplyNum = () => {
return get('/api/v1/contacts/apply-unread-num')
}
15 changes: 7 additions & 8 deletions src/views/example/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
</template>

<script>
import FriendApplyMessage from '@/components/chat/messaege/FriendApplyMessage'
export default {
components: { FriendApplyMessage },
Expand All @@ -17,11 +16,11 @@ export default {
}
</script>
<style lang="less" scoped>
.test{
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.test {
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
</style>

0 comments on commit faf75ad

Please sign in to comment.