获取当前用户信息,赋值给对应的组织架构树

pull/134/MERGE
xiaoliu 2023-07-10 20:32:37 +08:00 committed by 小诺
parent 3d6d1f93c2
commit 311352278f
1 changed files with 7 additions and 1 deletions

View File

@ -22,7 +22,13 @@
import userCenterApi from '@/api/sys/userCenterApi' import userCenterApi from '@/api/sys/userCenterApi'
let data = ref({}) let data = ref({})
userCenterApi.userLoginOrgTree().then((res) => { userCenterApi.userLoginOrgTree().then((res) => {
data.value = res[0] const userInfo = tool.data.get('USER_INFO')
res = Array.from(res)
res.forEach((item) => {
if (item.id === userInfo.orgId) {
data.value = item
}
})
}) })
</script> </script>