This commit is contained in:
xiaojunnuo
2024-10-03 01:29:12 +08:00
parent aeed24e87d
commit c9d18f6d8a
17 changed files with 100 additions and 34 deletions
+5 -1
View File
@@ -1,7 +1,7 @@
import axios from "axios";
import { get } from "lodash-es";
import Adapter from "axios-mock-adapter";
import { errorLog, errorCreate } from "./tools";
import { errorLog, errorCreate, response } from "./tools";
import { env } from "/src/utils/util.env";
import { useUserStore } from "../store/modules/user";
/**
@@ -96,6 +96,10 @@ function createService() {
const userStore = useUserStore();
userStore.logout();
}
if (error?.config?.onError) {
error.config.onError(error);
}
return Promise.reject(error);
}
);