去掉表单AI生成答案的接入,所有表单填写内容来源只能是简历或其他预设字段
This commit is contained in:
@@ -51,19 +51,36 @@ function Sidebar() {
|
||||
console.log("[OfferPie] 页面加载时获取到的 Token:", token)
|
||||
if (!token) return
|
||||
|
||||
// 有 token 时,先查询岗位信息,有岗位才自动打开面板
|
||||
findJobBySourceUrl(currentUrl).then((data) => {
|
||||
// 确定用于查询岗位信息的 URL:优先用 sessionStorage 缓存的(同标签页跳转后保留)
|
||||
const STORAGE_KEY = "offerpie_source_url"
|
||||
const cachedUrl = sessionStorage.getItem(STORAGE_KEY)
|
||||
const queryUrl = cachedUrl || currentUrl
|
||||
|
||||
// 查询岗位信息
|
||||
findJobBySourceUrl(queryUrl).then((data) => {
|
||||
console.log("[OfferPie] 岗位信息:", data)
|
||||
if (data && data.id) {
|
||||
setJobInfo(data)
|
||||
// 查到岗位后缓存当前查询成功的 URL
|
||||
sessionStorage.setItem(STORAGE_KEY, queryUrl)
|
||||
// 自动打开面板
|
||||
if (!autoOpenedRef.current) {
|
||||
autoOpenedRef.current = true
|
||||
setVisible(true)
|
||||
}
|
||||
} else if (!cachedUrl) {
|
||||
// 当前 URL 和缓存都没查到,不自动打开
|
||||
console.log("[OfferPie] 当前页面未匹配到岗位信息")
|
||||
}
|
||||
}).catch((err) => {
|
||||
console.warn("[OfferPie] 查询岗位信息失败:", err)
|
||||
})
|
||||
|
||||
// 如果有缓存 URL 且当前 URL 不同(跳转到了表单页),也自动打开面板
|
||||
if (cachedUrl && !autoOpenedRef.current) {
|
||||
autoOpenedRef.current = true
|
||||
setVisible(true)
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user