This commit is contained in:
冯辉
2026-05-01 04:02:50 +08:00
parent 57b18c0a65
commit 7ad59aeeab
4 changed files with 31 additions and 20 deletions

View File

@@ -6,8 +6,8 @@
*/ */
export default { export default {
// baseUrl: 'http://39.98.44.136:8080', // 测试 // baseUrl: 'http://39.98.44.136:8080', // 测试
// baseUrl: 'https://www.xjksly.cn/api/ks', // 正式环境 baseUrl: 'https://www.xjksly.cn/api/ks', // 正式环境
baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 测试 // baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 测试
// LCBaseUrl:'http://10.110.145.145:9100',//内网端口 // LCBaseUrl:'http://10.110.145.145:9100',//内网端口
// LCBaseUrlInner:'http://10.110.145.145:10100',//招聘、培训、帮扶 // LCBaseUrlInner:'http://10.110.145.145:10100',//招聘、培训、帮扶

View File

@@ -786,6 +786,7 @@ const rangeOptions = ref([
]); ]);
const isLoaded = ref(false); const isLoaded = ref(false);
const isInitialized = ref(false); // 添加初始化标志 const isInitialized = ref(false); // 添加初始化标志
const isRecommendLoading = ref(false); // 请求锁,防止重复调用
const { columnCount, columnSpace } = useColumnCount(() => { const { columnCount, columnSpace } = useColumnCount(() => {
pageState.pageSize = 10 * (columnCount.value - 1) + 10; pageState.pageSize = 10 * (columnCount.value - 1) + 10;
@@ -1243,10 +1244,12 @@ function handelHostestSearch(val) {
} }
function getJobRecommend(type = 'add') { function getJobRecommend(type = 'add') {
if (isRecommendLoading.value) return;
if (type === 'refresh') { if (type === 'refresh') {
list.value = []; list.value = [];
if (waterfallsFlowRef.value) waterfallsFlowRef.value.refresh(); if (waterfallsFlowRef.value) waterfallsFlowRef.value.refresh();
} }
isRecommendLoading.value = true;
let params = { let params = {
pageSize: pageState.pageSize + 10, pageSize: pageState.pageSize + 10,
sessionId: useUserStore().seesionId, sessionId: useUserStore().seesionId,
@@ -1320,6 +1323,8 @@ function getJobRecommend(type = 'add') {
if (!data.length) { if (!data.length) {
useUserStore().initSeesionId(); useUserStore().initSeesionId();
} }
}).finally(() => {
isRecommendLoading.value = false;
}); });
} }

View File

@@ -29,6 +29,7 @@ function buildIndex(tree) {
const useDictStore = defineStore("dict", () => { const useDictStore = defineStore("dict", () => {
// 定义状态 // 定义状态
const complete = ref(false) const complete = ref(false)
const dictLoading = ref(false)
const state = reactive({ const state = reactive({
education: [], education: [],
experience: [], experience: [],
@@ -43,13 +44,16 @@ const useDictStore = defineStore("dict", () => {
}) })
// political_affiliation // political_affiliation
const getDictData = async (dictType, dictName) => { const getDictData = async (dictType, dictName) => {
try {
if (dictType && dictName) { if (dictType && dictName) {
return getDictSelectOption(dictType).then((data) => { return getDictSelectOption(dictType).then((data) => {
state[dictName] = data state[dictName] = data
return data return data
}) })
} }
if (complete.value) return
if (dictLoading.value) return
dictLoading.value = true
try {
const [education, experience, area, scale, sex, affiliation, nature, noticeType] = const [education, experience, area, scale, sex, affiliation, nature, noticeType] =
await Promise.all([ await Promise.all([
getDictSelectOption('education'), getDictSelectOption('education'),
@@ -75,7 +79,6 @@ const useDictStore = defineStore("dict", () => {
} catch (error) { } catch (error) {
console.error('Error fetching dictionary data:', error); console.error('Error fetching dictionary data:', error);
// 确保即使出错也能返回空数组 // 确保即使出错也能返回空数组
if (!dictType && !dictName) {
state.education = []; state.education = [];
state.experience = []; state.experience = [];
state.area = []; state.area = [];
@@ -84,7 +87,8 @@ const useDictStore = defineStore("dict", () => {
state.affiliation = []; state.affiliation = [];
state.nature = []; state.nature = [];
state.noticeType = []; state.noticeType = [];
} } finally {
dictLoading.value = false
} }
}; };

View File

@@ -23,9 +23,11 @@ const encryptPathPrefixes = [
'/app/companycontact/', '/app/companycontact/',
'/app/appskill/', '/app/appskill/',
'/app/userworkexperiences/', '/app/userworkexperiences/',
'/app/appWxphoneSmsCode',
'/app/user/', '/app/user/',
'/app/user/resume/', '/app/user/resume/',
'/cms/job/recommen/', '/cms/job/recommen/',
'/app/appLoginPhone',
'/app/notice/', '/app/notice/',
]; ];
@@ -49,7 +51,7 @@ const isEncryptNeeded = (method, url) => {
const encryptRequestData = (data) => { const encryptRequestData = (data) => {
const jsonData = JSON.stringify(data); const jsonData = JSON.stringify(data);
// const jsonData = JSON.stringify({a: '1'}); // const jsonData = JSON.stringify({a: '1'});
console.log('[请求] 加密前:', jsonData) // console.log('[请求] 加密前:', jsonData)
return { return {
encrypted: true, encrypted: true,
encryptedData: sm4Encrypt(config.sm4Config.key, jsonData), encryptedData: sm4Encrypt(config.sm4Config.key, jsonData),
@@ -62,7 +64,7 @@ const handleResponseData = (resData) => {
if (resData?.encrypted) { if (resData?.encrypted) {
const decrypted = sm4Decrypt(config.sm4Config.key, resData.encryptedData); const decrypted = sm4Decrypt(config.sm4Config.key, resData.encryptedData);
resData = JSON.parse(decrypted); resData = JSON.parse(decrypted);
console.log('[请求] 解密后数据:', resData); // console.log('[请求] 解密后数据:', resData);
} }
} catch (e) { } catch (e) {
console.error('[请求] 解密失败:', e.message); console.error('[请求] 解密失败:', e.message);