|
@@ -1,4 +1,4 @@
|
|
|
-import { dateFormat, gendUrl } from "@/util";
|
|
|
+import { dateFormat, gendUrl, throttle } from "@/util";
|
|
|
import * as URL from "./URL";
|
|
|
import {
|
|
|
basePath,
|
|
@@ -12,6 +12,8 @@ import {
|
|
|
import { ElMessage } from "element-plus";
|
|
|
import { Relics, Scene, ScenePoint, ResPage, UserInfo, Device } from "./type";
|
|
|
|
|
|
+const error = throttle((msg: string) => ElMessage.error(msg), 2000);
|
|
|
+
|
|
|
type Other = { params?: Param; paths?: Param };
|
|
|
export const sendFetch = <T>(
|
|
|
url: string,
|
|
@@ -53,7 +55,7 @@ export const sendFetch = <T>(
|
|
|
})
|
|
|
.then((data) => {
|
|
|
if (data.code !== 0) {
|
|
|
- ElMessage.error(data.message);
|
|
|
+ error(data.message);
|
|
|
errorHook.map((err) => {
|
|
|
err(data.code, data.msg);
|
|
|
});
|