2 lines
1.3 KiB
JavaScript
2 lines
1.3 KiB
JavaScript
var u=Object.defineProperty,d=Object.defineProperties;var p=Object.getOwnPropertyDescriptors;var e=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var s=(r,t,o)=>t in r?u(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o,i=(r,t)=>{for(var o in t||(t={}))E.call(t,o)&&s(r,o,t[o]);if(e)for(var o of e(t))h.call(t,o)&&s(r,o,t[o]);return r},n=(r,t)=>d(r,p(t));import{bb as I,b8 as c}from"./index.600742c0.js";import{a as l}from"./dateUtil.dcd6267e.js";import{a as C}from"./exceptionEnum.1496ab9e.js";const x=I({id:"app-error-log",state:()=>({errorLogInfoList:null,errorLogListCount:0}),getters:{getErrorLogInfoList(){return this.errorLogInfoList||[]},getErrorLogListCount(){return this.errorLogListCount}},actions:{addErrorLogInfo(r){const t=n(i({},r),{time:l(new Date)});this.errorLogInfoList=[t,...this.errorLogInfoList||[]],this.errorLogListCount+=1},setErrorLogListCount(r){this.errorLogListCount=r},addAjaxErrorInfo(r){const{useErrorHandle:t}=c;if(!t)return;const o={message:r.message,type:C.AJAX};if(r.response){const{config:{url:a="",data:g="",method:L="get",headers:f={}}={},data:m={}}=r.response;o.url=a,o.name="Ajax Error!",o.file="-",o.stack=JSON.stringify(m),o.detail=JSON.stringify({params:g,method:L,headers:f})}this.addErrorLogInfo(o)}}});export{x as u};
|