diff --git a/config.js b/config.js index dff82d2..4f174da 100644 --- a/config.js +++ b/config.js @@ -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',//招聘、培训、帮扶 diff --git a/packageA/pages/complete-info/complete-info.vue b/packageA/pages/complete-info/complete-info.vue index 13fdd4c..4fe8672 100644 --- a/packageA/pages/complete-info/complete-info.vue +++ b/packageA/pages/complete-info/complete-info.vue @@ -47,7 +47,8 @@ /> {{ nameError }} - + + 性别 @@ -649,7 +650,6 @@ function nextStep() { validateName(); validateAge(); validateIdCard(); - validatePassword(); if (fromValue.sex !== 0 && fromValue.sex !== 1) { sexError.value = '请选择性别'; @@ -668,16 +668,6 @@ function nextStep() { return; } - // 密码校验 - if (!fromValue.ytjPassword) { - $api.msg('请输入密码'); - return; - } - if (passwordError.value) { - $api.msg(passwordError.value); - return; - } - // 检查所有错误状态 if (nameError.value) return; if (sexError.value) return; diff --git a/packageA/pages/job/publishJob.vue b/packageA/pages/job/publishJob.vue index 75d8625..059e9bf 100644 --- a/packageA/pages/job/publishJob.vue +++ b/packageA/pages/job/publishJob.vue @@ -373,8 +373,8 @@ console.log('完整userInfo对象:---223--', userType.value); // 页面加载时计算高度和初始化数据 onMounted(async () => { - console.log('完整userInfo对象:-----', ); - console.log('缓存中的userInfo:----', cachedUserInfo); + // console.log('完整userInfo对象:-----', ); + // console.log('缓存中的userInfo:----', cachedUserInfo); calculateScrollViewHeight(); await initFormData(); diff --git a/packageA/pages/personalInfo/personalInfo.vue b/packageA/pages/personalInfo/personalInfo.vue index d700d7e..4a2be78 100644 --- a/packageA/pages/personalInfo/personalInfo.vue +++ b/packageA/pages/personalInfo/personalInfo.vue @@ -17,7 +17,8 @@ 姓名 - + + 性别 @@ -213,43 +214,21 @@ watch(() => userInfo.value, (newVal) => { } }, { deep: true, immediate: false }); -// 监听字典数据加载完成,自动更新学历显示 -watch(() => dictComplete.value, (newVal) => { - if (newVal) { - console.log('字典数据加载完成,更新学历显示'); - // 确保有学历值(如果没有则使用默认值"4"本科) +watch([() => dictComplete.value, () => dictStore.state.education], ([completeVal, eduData]) => { + if (eduData && eduData.length > 0) { + console.log('学历字典数据已就绪,更新学历显示'); if (!fromValue.education) { fromValue.education = '4'; } - // 直接遍历字典数据查找对应标签 const eduValue = String(fromValue.education); - const eduItem = dictStore.state.education.find(item => String(item.value) === eduValue); + const eduItem = eduData.find(item => String(item.value) === eduValue); if (eduItem && eduItem.label) { console.log('从字典数据中找到学历标签:', eduItem.label); state.educationText = eduItem.label; } } -}); - -// 监听学历字典数据变化 -watch(() => dictStore.state.education, (newVal) => { - if (newVal && newVal.length > 0) { - console.log('学历字典数据变化,更新显示'); - // 确保有学历值(如果没有则使用默认值"4"本科) - if (!fromValue.education) { - fromValue.education = '4'; - } - - // 直接遍历字典数据查找对应标签 - const eduValue = String(fromValue.education); - const eduItem = newVal.find(item => String(item.value) === eduValue); - if (eduItem && eduItem.label) { - console.log('从字典数据中找到学历标签:', eduItem.label); - state.educationText = eduItem.label; - } - } -}, { deep: true }); +}, { immediate: true, deep: true }); function initLoad() { // 优先从 store 获取,如果没有则从本地缓存获取 @@ -296,17 +275,14 @@ function initLoad() { percent.value = result; } -// 初始化学历显示文本 function initEducationText() { - // 确保有学历值(如果没有则使用默认值"4"本科) if (!fromValue.education) { fromValue.education = '4'; } console.log('初始化学历显示,当前学历值:', fromValue.education); - // 直接遍历字典数据查找对应标签(不依赖dictLabel函数,确保准确性) - const findLabelFromDict = () => { + const findLabel = () => { if (dictStore.state.education && dictStore.state.education.length > 0) { const eduValue = String(fromValue.education); const eduItem = dictStore.state.education.find(item => String(item.value) === eduValue); @@ -314,48 +290,34 @@ function initEducationText() { console.log('从字典数据中找到学历标签:', eduItem.label); state.educationText = eduItem.label; return true; - } else { - console.log('字典数据中未找到匹配的学历标签'); } } return false; }; - // 立即尝试查找 - if (!findLabelFromDict() && dictComplete.value) { - // 如果字典数据已加载完成但未找到标签,尝试重新获取字典数据 - loadEducationDictAndUpdate(); + if (findLabel()) { + return; } - // 等待字典数据加载完成 - const checkDictData = () => { - if (dictComplete.value && dictStore.state.education && dictStore.state.education.length > 0) { - findLabelFromDict(); - } else { - // 如果字典数据未加载,等待一段时间后重试 - setTimeout(() => { - if (dictComplete.value && dictStore.state.education && dictStore.state.education.length > 0) { - findLabelFromDict(); - } else { - // 尝试主动加载字典数据 - loadEducationDictAndUpdate(); - } - }, 500); + let retryCount = 0; + const maxRetries = 10; + const retryInterval = 200; + + const checkDict = () => { + retryCount++; + if (retryCount >= maxRetries) { + console.log('学历字典数据加载超时'); + return; } + + if (findLabel()) { + return; + } + + setTimeout(checkDict, retryInterval); }; - // 主动加载学历字典数据并更新显示 - function loadEducationDictAndUpdate() { - getDictSelectOption('education').then((data) => { - console.log('主动加载学历字典数据:', data); - dictStore.state.education = data; - findLabelFromDict(); - }).catch((error) => { - console.error('加载学历字典数据失败:', error); - }); - } - - checkDictData(); + checkDict(); } const confirm = () => { if (!fromValue.name) { @@ -374,12 +336,6 @@ const confirm = () => { return $api.msg('请输入正确手机号'); } - // 密码校验 - validatePassword(); - if (fromValue.ytjPassword && passwordError.value) { - return $api.msg(passwordError.value); - } - // 构建appSkillsList数据结构 - 使用新的技能数据结构,包含id字段 const appSkillsList = state.skills .filter(skill => skill.name && skill.name.trim() !== '') diff --git a/pages/index/components/index-one.vue b/pages/index/components/index-one.vue index 3749736..379e3ec 100644 --- a/pages/index/components/index-one.vue +++ b/pages/index/components/index-one.vue @@ -807,7 +807,7 @@ const { columnCount, columnSpace } = useColumnCount(() => { const getCompanyInfo = () => { try { const cachedUserInfo = uni.getStorageSync('userInfo') || {}; - console.log('缓存中的userInfo:', cachedUserInfo); + // console.log('缓存中的userInfo:', cachedUserInfo); // 重置企业信息 companyInfo.name = ''; @@ -902,7 +902,7 @@ onShow(() => { // 页面显示时获取最新的企业信息 getCompanyInfo(); // 四级联动单点及权限 - getIsFourLevelLinkagePurview(); + // getIsFourLevelLinkagePurview(); }); // 监听用户信息变化,当登录状态改变时重新获取企业信息 diff --git a/pages/mine/company-info.vue b/pages/mine/company-info.vue index 1a6a3c8..7455c35 100644 --- a/pages/mine/company-info.vue +++ b/pages/mine/company-info.vue @@ -164,7 +164,7 @@ onShow(() => { function getCompanyInfo() { try { const cachedUserInfo = uni.getStorageSync('userInfo') || {}; - console.log('缓存中的userInfo:', cachedUserInfo); + // console.log('缓存中的userInfo:', cachedUserInfo); // 检查是否有company字段 if (cachedUserInfo.company) { diff --git a/pages/mine/company-mine.vue b/pages/mine/company-mine.vue index f718609..4f613cc 100644 --- a/pages/mine/company-mine.vue +++ b/pages/mine/company-mine.vue @@ -234,7 +234,7 @@ onUnmounted(() => { function getCompanyInfo() { try { const cachedUserInfo = uni.getStorageSync('userInfo') || {}; - console.log('缓存中的userInfo:', cachedUserInfo); + // console.log('缓存中的userInfo:', cachedUserInfo); // 检查是否有company字段 if (cachedUserInfo.company) { diff --git a/stores/useDictStore.js b/stores/useDictStore.js index d023955..cae10f5 100644 --- a/stores/useDictStore.js +++ b/stores/useDictStore.js @@ -116,7 +116,7 @@ const useDictStore = defineStore("dict", () => { if (state[dictType] && Array.isArray(state[dictType])) { for (let i = 0; i < state[dictType].length; i++) { let element = state[dictType][i]; - if (element.value === value) { + if (String(element.value) === String(value)) { return element.label } }