chore: remove and replace log with info

This commit is contained in:
Tristan Yang
2022-09-01 18:34:59 +08:00
parent ffbdc212f7
commit 3247de57db
36 changed files with 37 additions and 77 deletions
+2 -2
View File
@@ -29,7 +29,7 @@ const whiteList = [
const baseQuery = fetchBaseQuery({
baseUrl: BASE_URL,
prepareHeaders: (headers, { getState, endpoint }) => {
console.log("req", endpoint);
console.info("req", endpoint);
const { token } = (getState() as RootState).authData;
if (token && !whiteList.includes(endpoint)) {
headers.set(tokenHeader, token);
@@ -73,7 +73,7 @@ const baseQueryWithTokenCheck = async (args, api, extraOptions) => {
result = await baseQuery(args, api, extraOptions);
}
if (result?.error) {
console.log("api error", result.error, api.endpoint);
console.error("api error", result.error, api.endpoint);
switch (result.error.originalStatus || result.error.status) {
case "FETCH_ERROR":
{