feat: lots updates

This commit is contained in:
zerosoul
2022-01-30 21:30:12 +08:00
parent e18c7323a6
commit ceb02d834f
38 changed files with 1943 additions and 1832 deletions
+4 -12
View File
@@ -1,20 +1,12 @@
import { fetchBaseQuery } from "@reduxjs/toolkit/query";
import BASE_URL, { tokenHeader } from "../config";
// const whiteList = [
// "/resource/avatar",
// "/resource/company/logo",
// "/resource/thumbnail",
// "/resource/image",
// "/token/login",
// "/token/renew",
// "/user",
// "/admin/system/company",
// ];
const whiteList = ["login"];
const baseQuery = fetchBaseQuery({
baseUrl: BASE_URL,
prepareHeaders: (headers, { getState }) => {
prepareHeaders: (headers, { getState, endpoint }) => {
console.log("req", endpoint);
const { token } = getState().authData;
if (token) {
if (token && !whiteList.includes(endpoint)) {
headers.set(tokenHeader, token);
}
return headers;