1. 程式人生 > 其它 >6 款安全研究人員用來追蹤黑客事件的工具

6 款安全研究人員用來追蹤黑客事件的工具

公共方法 

utils 裡

export function downloadFile(obj, name, suffix) {   if (window.navigator.msSaveOrOpenBlob) {     // 相容IE     const blob = new Blob([obj])     const fileName = parseTime(new Date()) + '-' + name + '.' + suffix     navigator.msSaveBlob(blob, fileName)   } else {     const url = window.URL.createObjectURL(new Blob([obj]))     const link = document.createElement('a')     link.style.display = 'none'     link.href = url     const fileName = parseTime(new Date()) + '-' + name + '.' + suffix     link.setAttribute('download', fileName)     document.body.appendChild(link)     link.click()     document.body.removeChild(link)   } }   使用  import { downloadFile } from '@/utils/index'   rechargeLogDownload(params)         .then((result) => {           downloadFile(result, '充值記錄', 'xlsx')   //  downloadFile(result, '充值記錄', 'pdf')           this.downloadLoading = false         })         .catch(() => {           this.downloadLoading = false         })