1
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
|||||||
import { history } from '@umijs/max';
|
import { history } from '@umijs/max';
|
||||||
import { getJobTitleTreeSelect, getJobRecommend } from '@/services/common/jobTitle';
|
import { getJobTitleTreeSelect, getJobRecommend } from '@/services/common/jobTitle';
|
||||||
import { getGetInfoCache, saveGetInfoCache } from '@/utils/jobPortalAuth';
|
import { getGetInfoCache, saveGetInfoCache } from '@/utils/jobPortalAuth';
|
||||||
|
import { getAccessToken } from '@/access';
|
||||||
import { getUserInfo } from '@/services/session';
|
import { getUserInfo } from '@/services/session';
|
||||||
import JobPortalHeader from '@/components/JobPortalHeader';
|
import JobPortalHeader from '@/components/JobPortalHeader';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
@@ -144,7 +145,8 @@ const JobPortalPage: React.FC = () => {
|
|||||||
setJobTitles(cached);
|
setJobTitles(cached);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 缓存不存在则请求 /api/getInfo 写入后再读取
|
// 未登录用户不请求 /api/getInfo,避免 401 触发强制跳转登录页
|
||||||
|
if (!getAccessToken()) return;
|
||||||
getUserInfo({ skipErrorHandler: true })
|
getUserInfo({ skipErrorHandler: true })
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
saveGetInfoCache(res as Record<string, unknown>);
|
saveGetInfoCache(res as Record<string, unknown>);
|
||||||
|
|||||||
Reference in New Issue
Block a user