This commit is contained in:
杨志
2026-01-21 08:39:32 +08:00
parent c36f73caa2
commit e964409bb7
10 changed files with 963 additions and 8 deletions

View File

@@ -237,7 +237,13 @@
</head>
<body>
<div class="container">
<h1>职位信息爬虫工具</h1>
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;">
<h1 style="margin: 0;">职位信息爬虫工具</h1>
<div style="display: flex; gap: 15px;">
<a href="/user" style="color: #2196F3; text-decoration: none; padding: 8px 15px; border-radius: 4px; background: #e3f2fd;">账号管理</a>
<a href="/auth/logout" style="color: #f44336; text-decoration: none; padding: 8px 15px; border-radius: 4px; background: #ffebee;">退出登录</a>
</div>
</div>
<!-- 第一步:填写基础信息 -->
<div class="form-section">
@@ -323,6 +329,9 @@
</div>
<script>
// API基础路径配置
const API_BASE_URL = ''; // 空字符串表示使用相对路径如需跨域可修改为完整URL'http://your-domain.com'
// 复用同一个aa确保selectPosition与getPositionTree的Referer一致
let lastAa = '';
let lastResults = [];
@@ -348,7 +357,7 @@
showMessage('dsdm-message', '正在获取地区选项...', 'info');
fetch('/crawler/getDsdmOptions', {
fetch(API_BASE_URL + '/crawler/getDsdmOptions', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
@@ -403,7 +412,7 @@
showMessage('zwdm-message', '正在获取职位代码列表...', 'info');
fetch('/crawler/getZwdmList', {
fetch(API_BASE_URL + '/crawler/getZwdmList', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
@@ -495,7 +504,7 @@
showMessage('result-message', `正在获取 ${zwdmList.length} 个职位的信息,请稍候...`, 'info');
fetch('/crawler/batchGetPositionInfo', {
fetch(API_BASE_URL + '/crawler/batchGetPositionInfo', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
@@ -637,7 +646,7 @@
// 逐条获取职位详情
for (let i = 0; i < codes.length; i++) {
const code = codes[i];
const infoResp = await fetch('/crawler/getPositionInfo', {
const infoResp = await fetch(API_BASE_URL + '/crawler/getPositionInfo', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: `zwdm=${encodeURIComponent(code)}&examid=${encodeURIComponent(examid)}&cookies=${encodeURIComponent(JSON.stringify(cookieData))}`