Browse Source

chore(error-handle): 处理vue errorHandler绑定事件的参数类型不一致

invalid w 1 năm trước cách đây
mục cha
commit
cea297ce88
1 tập tin đã thay đổi với 3 bổ sung4 xóa
  1. 3 4
      src/logics/error-handle/index.ts

+ 3 - 4
src/logics/error-handle/index.ts

@@ -62,16 +62,15 @@ function formatComponentName(vm: any) {
 /**
  * Configure Vue error handling function
  */
-
-function vueErrorHandler(err: Error, vm: any, info: string) {
+function vueErrorHandler(err: unknown, vm: any, info: string) {
   const errorLogStore = useErrorLogStoreWithOut();
   const { name, path } = formatComponentName(vm);
   errorLogStore.addErrorLogInfo({
     type: ErrorTypeEnum.VUE,
     name,
     file: path,
-    message: err.message,
-    stack: processStackMsg(err),
+    message: (err as Error).message,
+    stack: processStackMsg(err as Error),
     detail: info,
     url: window.location.href,
   });