diff --git a/packageA/pages/post/post.vue b/packageA/pages/post/post.vue index c004d3e..1f118fb 100644 --- a/packageA/pages/post/post.vue +++ b/packageA/pages/post/post.vue @@ -100,7 +100,7 @@ > - + 竞争力分析 @@ -193,6 +193,12 @@ import RadarMap from './component/radarMap.vue'; import { storeToRefs } from 'pinia'; import useUserStore from '@/stores/useUserStore'; const { userInfo } = storeToRefs(useUserStore()); +// 与首页一致的用户类型获取:优先store,兜底缓存 +const currentUserType = computed(() => { + const storeIsCompanyUser = userInfo.value?.isCompanyUser; + const cachedIsCompanyUser = (uni.getStorageSync('userInfo') || {}).isCompanyUser; + return Number(storeIsCompanyUser !== undefined ? storeIsCompanyUser : cachedIsCompanyUser); +}); const { $api, navTo, getLenPx, parseQueryParams, navBack, isEmptyObject } = inject('globalFunction'); import config from '@/config.js'; const matchingDegree = ref(['一般', '良好', '优秀', '极好']); @@ -265,11 +271,11 @@ function seeExplain() { function getDetail(jobId) { return new Promise((reslove, reject) => { $api.createRequest(`/app/job/${jobId}`).then((resData) => { - const { latitude, longitude, companyName, companyId, isCompanyUser } = resData.data; + const { latitude, longitude, companyName, companyId } = resData.data; jobInfo.value = resData.data; reslove(resData.data); getCompanyIsAJobs(companyId); - if (isCompanyUser) { + if (currentUserType.value !== 0) { getCompetivetuveness(jobId); } // getCompetivetuveness(jobId);