fix(dict): 🐛 移除字典组件的 WebSocket 监听器,以防止在注销登录期间出现无效令牌请求
This commit is contained in:
@@ -53,18 +53,14 @@ const updateLabelAndTag = async () => {
|
||||
tagType.value = newTagType as typeof tagType.value;
|
||||
};
|
||||
|
||||
watch([() => props.code, () => props.modelValue], updateLabelAndTag);
|
||||
|
||||
onMounted(updateLabelAndTag);
|
||||
|
||||
// 监听WebSocket字典更新事件,强制刷新标签
|
||||
// 初始化或code变化时更新标签和标签样式
|
||||
watch(
|
||||
() => dictStore.getDictItems(props.code || ""),
|
||||
[() => props.code, () => props.modelValue],
|
||||
async () => {
|
||||
if (props.code) {
|
||||
await updateLabelAndTag();
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -120,13 +120,4 @@ onMounted(async () => {
|
||||
await dictStore.loadDictItems(props.code);
|
||||
options.value = dictStore.getDictItems(props.code);
|
||||
});
|
||||
|
||||
// 监听字典数据变化,确保WebSocket更新时刷新选项
|
||||
watch(
|
||||
() => dictStore.getDictItems(props.code),
|
||||
(newItems) => {
|
||||
options.value = newItems;
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user