try{
// 设置错误的接口参数
const params = {
google: 't-100142',
operating: 'select'
}
getDataApi(paramsd).then(res => {
})
}
catch(err){
// 扑捉异常
const text = `日志异常内容:${err}`
const blob = new Blob([text], {type: 'text/plain'});
let formData = new FormData();
formData.append("file", blob, `${new Date().getTime()}.txt`);
uploadException(formData).then(res => {
})
}
<?PHP
move_uploaded_file($_FILES["file"]["tmp_name"], "log/".$_FILES["file"]["name"])
?>