修复筛选字典数据加载竞态

This commit is contained in:
Apcallover
2026-07-23 21:29:45 +08:00
parent 2c29c2a792
commit 4c8f79555d
3 changed files with 91 additions and 80 deletions

View File

@@ -847,6 +847,28 @@ onUnmounted(() => {
uni.$off('citySelected');
});
const isFourLevelLinkagePurview = ref(false);
const getIsFourLevelLinkagePurview = () => {
let userInfo = uni.getStorageSync('userInfo');
if (userInfo) {
$api.myRequest(
'/auth/login2/ks',
{ userid: userInfo.dwUserid, idcardno: userInfo.idCard },
'POST',
9100,
{}
).then((res) => {
if (res.code == 200) {
uni.setStorageSync('fourLevelLinkage-token', res.data.access_token);
let roleIdList = ['103', '106', '107'];
if (res.data.roleIdList.some((item) => roleIdList.includes(item))) {
isFourLevelLinkagePurview.value = true;
}
}
});
}
};
onShow(() => {
// 页面显示时获取最新的企业信息
getCompanyInfo();
@@ -1458,27 +1480,6 @@ const toggleJobStatus = (job) => {
$api.msg(isCurrentlyUp ? '下架失败,请重试' : '上架失败,请重试');
});
};
const isFourLevelLinkagePurview = ref(false);
const getIsFourLevelLinkagePurview = () => {
let userInfo = uni.getStorageSync('userInfo');
if (userInfo) {
$api.myRequest(
'/auth/login2/ks',
{ userid: userInfo.dwUserid, idcardno: userInfo.idCard },
'POST',
9100,
{}
).then((res) => {
if (res.code == 200) {
uni.setStorageSync('fourLevelLinkage-token', res.data.access_token);
let roleIdList = ['103', '106', '107'];
if (res.data.roleIdList.some((item) => roleIdList.includes(item))) {
isFourLevelLinkagePurview.value = true;
}
}
});
}
};
function dataToImg(data) {
const result = data.map((item) => ({
...item,