chore: update commnents

This commit is contained in:
Tristan Yang
2022-08-01 23:25:22 +08:00
parent c12b94742a
commit bba42f2f45
6 changed files with 56 additions and 13 deletions
+1 -1
View File
@@ -1,8 +1,8 @@
// const BASE_URL = `${location.origin}/api`;
// const BASE_URL = `https://dev.voce.chat/api`;
const BASE_URL = process.env.REACT_APP_RELEASE
? `${location.origin}/api`
: `https://dev.voce.chat/api`;
// const BASE_URL = `https://dev.voce.chat/api`;
export const CACHE_VERSION = `0.3.1`;
export const ContentTypes = {
text: "text/plain",
+1
View File
@@ -45,6 +45,7 @@ const baseQueryWithTokenCheck = async (args, api, extraOptions) => {
// 先检查token是否过期,过期则renew
const { token, refreshToken, expireTime = +new Date() } = api.getState().authData;
let result = null;
console.log("base check", whiteList.includes(api.endpoint), api.endpoint);
if (!whiteList.includes(api.endpoint) && dayjs().isAfter(new Date(expireTime - 20 * 1000))) {
// 快过期了,renew
waitingForRenew = baseQuery(