common.js 949 B

123456789101112131415161718192021222324252627282930
  1. import { getNote } from '../utils/index'
  2. export default {
  3. methods: {
  4. async verifyConcact (item, data) {
  5. if (item.verified) return false
  6. if (['dingtalk', 'feishu', 'workwx'].includes(item.contact_type)) {
  7. try {
  8. const res = await new this.$Manager('receivers', 'v1').performAction({
  9. id: data.id,
  10. action: 'trigger-verify',
  11. data: {
  12. contact_type: item.contact_type,
  13. },
  14. })
  15. const verified_infos = res.data.verified_infos || []
  16. const verified_info = verified_infos.find(v => v.contact_type === item.contact_type)
  17. if (!verified_info.verified) {
  18. const note = getNote(verified_info.note)
  19. this.$message.error(note)
  20. }
  21. // this.refresh()
  22. this.$bus.$emit('ContactListSingleRefresh', data.id)
  23. } catch (error) {
  24. throw error
  25. }
  26. }
  27. },
  28. },
  29. }