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 {
// baseUrl: 'http://39.98.44.136:8080', // 测试
// baseUrl: 'https://www.xjksly.cn/api/ks', // 正式环境
baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 测试
baseUrl: 'https://www.xjksly.cn/api/ks', // 正式环境
// baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 测试
// LCBaseUrl:'http://10.110.145.145:9100',//内网端口
// LCBaseUrlInner:'http://10.110.145.145:10100',//招聘、培训、帮扶

View File

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

View File

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

View File

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