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

This commit is contained in:
francis-fh
2026-06-17 19:23:41 +08:00
parent 183a25f709
commit 17c1c89639

View File

@@ -16,6 +16,7 @@ import {
import { history } from '@umijs/max';
import { getJobTitleTreeSelect, getJobRecommend } from '@/services/common/jobTitle';
import { getGetInfoCache, saveGetInfoCache } from '@/utils/jobPortalAuth';
import { getAccessToken } from '@/access';
import { getUserInfo } from '@/services/session';
import JobPortalHeader from '@/components/JobPortalHeader';
import './index.less';
@@ -144,7 +145,8 @@ const JobPortalPage: React.FC = () => {
setJobTitles(cached);
return;
}
// 缓存不存在则请求 /api/getInfo 写入后再读取
// 未登录用户不请求 /api/getInfo,避免 401 触发强制跳转登录页
if (!getAccessToken()) return;
getUserInfo({ skipErrorHandler: true })
.then((res: any) => {
saveGetInfoCache(res as Record<string, unknown>);