@sigmaott/base-next 1.1.8 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/api/axios.ts +9 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sigmaott/base-next",
3
3
  "type": "module",
4
- "version": "1.1.8",
4
+ "version": "1.1.9",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
package/src/api/axios.ts CHANGED
@@ -18,7 +18,14 @@ export const service = axios.create({
18
18
  baseURL: window.__NUXT__.config.public.apiBase,
19
19
  })
20
20
 
21
- const showError = useThrottleFn((statusCode: any, error: any) => {
21
+ let lastErrorTime = 0
22
+ const showError = (statusCode: any, error: any) => {
23
+ const now = Date.now()
24
+ if (now - lastErrorTime < 1500) {
25
+ return // Skip if called too frequently
26
+ }
27
+ lastErrorTime = now
28
+
22
29
  ElNotification({
23
30
  title: `${[window.translate?.('global.error'), statusCode || ''].join(' ')}`,
24
31
  type: 'error',
@@ -28,7 +35,7 @@ const showError = useThrottleFn((statusCode: any, error: any) => {
28
35
  customClass: '!w-[650px] !z-69999',
29
36
  modalClass: '!z-69999',
30
37
  })
31
- }, 1500)
38
+ }
32
39
 
33
40
  export function addInterceptor(service: AxiosInstance, transformRes?: (res) => any) {
34
41
  service.interceptors.request.use((config) => {