up
This commit is contained in:
@@ -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))}`
|
||||
|
||||
Reference in New Issue
Block a user